Skip to content

Commit d080766

Browse files
Uwe Kleine-Königcminyard
authored andcommitted
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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Corey Minyard <[email protected]>
1 parent 6d2555c commit d080766

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/char/ipmi/ipmi_ssif.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,9 +1281,6 @@ static void ssif_remove(struct i2c_client *client)
12811281
struct ssif_info *ssif_info = i2c_get_clientdata(client);
12821282
struct ssif_addr_info *addr_info;
12831283

1284-
if (!ssif_info)
1285-
return;
1286-
12871284
/*
12881285
* After this point, we won't deliver anything asynchronously
12891286
* to the message handler. We can unregister ourself.
@@ -2073,9 +2070,6 @@ static int ssif_platform_remove(struct platform_device *dev)
20732070
{
20742071
struct ssif_addr_info *addr_info = dev_get_drvdata(&dev->dev);
20752072

2076-
if (!addr_info)
2077-
return 0;
2078-
20792073
mutex_lock(&ssif_infos_mutex);
20802074
list_del(&addr_info->link);
20812075
kfree(addr_info);

0 commit comments

Comments
 (0)