Skip to content

Commit

Permalink
tpm/tpm_i2c_stm_st33: Fix coccinelle warnings. Possible NULL pointer …
Browse files Browse the repository at this point in the history
…dereference

If !client the kernel mays oops in dev_info when doing client->dev.

Reported-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
  • Loading branch information
Christophe Ricard authored and Peter Huewe committed Jan 17, 2015
1 parent f2f083b commit 67fe941
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/tpm/tpm_i2c_stm_st33.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ tpm_stm_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
struct tpm_stm_dev *tpm_dev;

if (!client) {
dev_info(&client->dev, "%s: i2c client is NULL. Device not accessible.\n",
pr_info("%s: i2c client is NULL. Device not accessible.\n",
__func__);
return -ENODEV;
}
Expand Down

0 comments on commit 67fe941

Please sign in to comment.