Skip to content

Commit a8627cd

Browse files
GustavoARSilvacminyard
authored andcommitted
ipmi: Fix NULL pointer dereference in ssif_probe
There is a potential execution path in which function ssif_info_find() returns NULL, hence there is a NULL pointer dereference when accessing pointer *addr_info* Fix this by null checking *addr_info* before dereferencing it. Addresses-Coverity-ID: 1473145 ("Explicit null dereferenced") Fixes: e333054a91d1 ("ipmi: Fix I2C client removal in the SSIF driver") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Corey Minyard <[email protected]>
1 parent 0745dde commit a8627cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/char/ipmi/ipmi_ssif.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,9 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id)
16431643

16441644
out:
16451645
if (rv) {
1646-
addr_info->client = NULL;
1646+
if (addr_info)
1647+
addr_info->client = NULL;
1648+
16471649
dev_err(&client->dev, "Unable to start IPMI SSIF: %d\n", rv);
16481650
kfree(ssif_info);
16491651
}

0 commit comments

Comments
 (0)