From: Andy Shevchenko Date: Mon, 3 Aug 2020 08:35:20 +0000 (+0300) Subject: kobject: Drop unneeded conditional in __kobject_del() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=07ecc6693f9157cf293da5d165c73fb28fd69bf4;p=linux.git 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 Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20200803083520.5460-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/lib/kobject.c b/lib/kobject.c index 9dce68c378e61..ea53b30cf4837 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -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);