summaryrefslogtreecommitdiffstats
path: root/lib/kobject.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-08-03 11:35:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-07 11:24:17 +0200
commit07ecc6693f9157cf293da5d165c73fb28fd69bf4 (patch)
tree7209b52a587f76c34c8a6be0dfcb5b32a0df67a6 /lib/kobject.c
parent6b57b15abe11aa334ebf726e02c0deaf123ba040 (diff)
downloadlinux-07ecc6693f9157cf293da5d165c73fb28fd69bf4.tar.bz2
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>
Diffstat (limited to 'lib/kobject.c')
-rw-r--r--lib/kobject.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 9dce68c378e6..ea53b30cf483 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);