Skip to content

Commit e8e7be7

Browse files
Wolfram SangPaolo Abeni
authored andcommitted
mctp i2c: drop check because i2c_unregister_device() is NULL safe
No need to check the argument of i2c_unregister_device() because the function itself does it. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://patch.msgid.link/20241202082713.9719-1-wsa+renesas@sang-engineering.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent b32913a commit e8e7be7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/mctp/mctp-i2c.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ static struct mctp_i2c_client *mctp_i2c_new_client(struct i2c_client *client)
177177
return mcli;
178178
err:
179179
if (mcli) {
180-
if (mcli->client)
181-
i2c_unregister_device(mcli->client);
180+
i2c_unregister_device(mcli->client);
182181
kfree(mcli);
183182
}
184183
return ERR_PTR(rc);

0 commit comments

Comments
 (0)