tpm/tpm_i2c_stm_st33: Fix coccinelle warnings. Possible NULL pointer 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>
This commit is contained in:
Christophe Ricard 2014-12-02 21:06:03 +01:00 committed by Peter Huewe
parent f2f083b5d4
commit 67fe94175a
1 changed files with 1 additions and 1 deletions

View File

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