aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/sysfs.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-06-13 14:45:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:09:03 -0400
commit7a23ad44047b1084a032bc0d127fe08af024593a (patch)
tree1f1819b0897fdd8e0237f22d8eebeb55b75894b9 /fs/sysfs/sysfs.h
parent2b611bb7abdcc08278453fc9f6517401fd69ef95 (diff)
sysfs: make sysfs_put() ignore NULL sd
Make sysfs_put() ignore NULL sd instead of oopsing. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r--fs/sysfs/sysfs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 687d959f606d..f4fdbbffd571 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -111,7 +111,7 @@ static inline struct sysfs_dirent * sysfs_get(struct sysfs_dirent * sd)
111 111
112static inline void sysfs_put(struct sysfs_dirent * sd) 112static inline void sysfs_put(struct sysfs_dirent * sd)
113{ 113{
114 if (atomic_dec_and_test(&sd->s_count)) 114 if (sd && atomic_dec_and_test(&sd->s_count))
115 release_sysfs_dirent(sd); 115 release_sysfs_dirent(sd);
116} 116}
117 117