summaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2022-12-30 13:44:31 +0100
committerCorey Minyard <minyard@acm.org>2023-04-12 18:13:26 +0200
commitd08076678ce72140a40553d226f90d189fbe06d1 (patch)
tree726936820c8cf01ea8229131c44197b8f176338f /drivers/char/ipmi
parentipmi: fix SSIF not responding under certain cond. (diff)
downloadlinux-d08076678ce72140a40553d226f90d189fbe06d1.tar.xz
linux-d08076678ce72140a40553d226f90d189fbe06d1.zip
ipmi:ssif: Drop if blocks with always false condition
For both variants (platform and i2c driver) after a successful bind (i.e. .probe completed without error) driver data is set to a non-NULL value. So the return value of i2c_get_clientdata and dev_get_drvdata respectively are not NULL and so the if blocks are never executed. (And if you fear they might, they shouldn't return silently and yield a resource leak.) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Message-Id: <20221230124431.202474-1-u.kleine-koenig@pengutronix.de> Signed-off-by: Corey Minyard <minyard@acm.org>
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r--drivers/char/ipmi/ipmi_ssif.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index 0eca46eea35c..3b921c78ba08 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -1281,9 +1281,6 @@ static void ssif_remove(struct i2c_client *client)
struct ssif_info *ssif_info = i2c_get_clientdata(client);
struct ssif_addr_info *addr_info;
- if (!ssif_info)
- return;
-
/*
* After this point, we won't deliver anything asynchronously
* to the message handler. We can unregister ourself.
@@ -2073,9 +2070,6 @@ static int ssif_platform_remove(struct platform_device *dev)
{
struct ssif_addr_info *addr_info = dev_get_drvdata(&dev->dev);
- if (!addr_info)
- return 0;
-
mutex_lock(&ssif_infos_mutex);
list_del(&addr_info->link);
kfree(addr_info);