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>
This commit is contained in:
Wolfram Sang 2024-12-02 09:27:13 +01:00 committed by Paolo Abeni
parent b32913a560
commit e8e7be7d21

View File

@ -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);