From htejun@gmail.com Sat Apr 28 06:39:51 2007 From: Tejun Heo Date: Sat, 28 Apr 2007 22:39:40 +0900 Subject: [PATCH 06/21] sysfs: make sysfs_put() ignore NULL sd To: gregkh@suse.de, dmitry.torokhov@gmail.com, cornelia.huck@de.ibm.com, oneukum@suse.de, rpurdie@rpsys.net, stern@rowland.harvard.edu, maneesh@in.ibm.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, htejun@gmail.com Cc: Tejun Heo Message-ID: <11777675802688-git-send-email-htejun@gmail.com> Make sysfs_put() ignore NULL sd instead of oopsing. Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/sysfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h @@ -110,7 +110,7 @@ static inline struct sysfs_dirent * sysf static inline void sysfs_put(struct sysfs_dirent * sd) { - if (atomic_dec_and_test(&sd->s_count)) + if (sd && atomic_dec_and_test(&sd->s_count)) release_sysfs_dirent(sd); }