From htejun@gmail.com Fri Apr 20 11:00:10 2007 From: Tejun Heo Date: Sat, 21 Apr 2007 02:08:23 +0900 Subject: sysfs: make sysfs_put() ignore NULL sd To: , , , , , , htejun@gmail.com Cc: Tejun Heo Message-ID: <11770889032044-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 @@ -86,7 +86,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); }