From: Christophe Ricard Date: Tue, 2 Dec 2014 20:06:03 +0000 (+0100) Subject: tpm/tpm_i2c_stm_st33: Fix coccinelle warnings. Possible NULL pointer dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=67fe94175a3e2da2bb0897f644ed856b8528c633;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Christophe Ricard Signed-off-by: Peter Huewe --- diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c b/drivers/char/tpm/tpm_i2c_stm_st33.c index e643c8627b7d..86203b022d13 100644 --- a/drivers/char/tpm/tpm_i2c_stm_st33.c +++ b/drivers/char/tpm/tpm_i2c_stm_st33.c @@ -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; }