[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200914130502.1804708-10-sashal@kernel.org>
Date: Mon, 14 Sep 2020 09:04:53 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH AUTOSEL 4.19 10/19] kobject: Drop unneeded conditional in __kobject_del()
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
[ Upstream commit 07ecc6693f9157cf293da5d165c73fb28fd69bf4 ]
__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@...ux.intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Link: https://lore.kernel.org/r/20200803083520.5460-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
lib/kobject.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lib/kobject.c b/lib/kobject.c
index 97d86dc17c42b..6483c11e2e74f 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -585,9 +585,6 @@ void kobject_del(struct kobject *kobj)
{
struct kernfs_node *sd;
- if (!kobj)
- return;
-
sd = kobj->sd;
sysfs_remove_dir(kobj);
sysfs_put(sd);
--
2.25.1
Powered by blists - more mailing lists