Skip to content

Commit 07ecc66

Browse files
andy-shevgregkh
authored andcommitted
kobject: Drop unneeded conditional in __kobject_del()
__kobject_del() is called from two places, in one where kobj is dereferenced before and thus can't be NULL, and in the other the NULL check is done before call. Drop unneeded conditional in __kobject_del(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/20200803083520.5460-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6b57b15 commit 07ecc66

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lib/kobject.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,6 @@ static void __kobject_del(struct kobject *kobj)
604604
struct kernfs_node *sd;
605605
const struct kobj_type *ktype;
606606

607-
if (!kobj)
608-
return;
609-
610607
sd = kobj->sd;
611608
ktype = get_ktype(kobj);
612609

0 commit comments

Comments
 (0)