Skip to content

Commit

Permalink
kobject: Drop unneeded conditional in __kobject_del()
Browse files Browse the repository at this point in the history
__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 <[email protected]>
Reviewed-by: Rafael J. Wysocki <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
andy-shev authored and gregkh committed Sep 7, 2020
1 parent 6b57b15 commit 07ecc66
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,6 @@ static void __kobject_del(struct kobject *kobj)
struct kernfs_node *sd;
const struct kobj_type *ktype;

if (!kobj)
return;

sd = kobj->sd;
ktype = get_ktype(kobj);

Expand Down

0 comments on commit 07ecc66

Please sign in to comment.