Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a23ad44 authored by Tejun Heo's avatar Tejun Heo Committed by Greg Kroah-Hartman
Browse files

sysfs: make sysfs_put() ignore NULL sd



Make sysfs_put() ignore NULL sd instead of oopsing.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2b611bb7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
}