mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
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>
This commit is contained in:
parent
2b611bb7ab
commit
7a23ad4404
1 changed files with 1 additions and 1 deletions
|
@ -111,7 +111,7 @@ static inline struct sysfs_dirent * sysfs_get(struct sysfs_dirent * sd)
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue