Skip to content

Commit

Permalink
mctp i2c: drop check because i2c_unregister_device() is NULL safe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wolfram Sang authored and Paolo Abeni committed Dec 3, 2024
1 parent b32913a commit e8e7be7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/mctp/mctp-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ static struct mctp_i2c_client *mctp_i2c_new_client(struct i2c_client *client)
return mcli;
err:
if (mcli) {
if (mcli->client)
i2c_unregister_device(mcli->client);
i2c_unregister_device(mcli->client);
kfree(mcli);
}
return ERR_PTR(rc);
Expand Down

0 comments on commit e8e7be7

Please sign in to comment.