aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_i2c_stm_st33.h
diff options
context:
space:
mode:
authorKent Yoder <key@linux.vnet.ibm.com>2013-01-18 17:42:25 -0600
committerKent Yoder <key@linux.vnet.ibm.com>2013-02-05 09:38:24 -0600
commit1fbc5e95356a4600fab3a04a82dc8bb49591aedd (patch)
treedd1a2e3d7370d592c58fdee2e983d2f80412bb07 /drivers/char/tpm/tpm_i2c_stm_st33.h
parentchar/tpm: Use struct dev_pm_ops for power management (diff)
downloadlinux-dev-1fbc5e95356a4600fab3a04a82dc8bb49591aedd.tar.xz
linux-dev-1fbc5e95356a4600fab3a04a82dc8bb49591aedd.zip
tpm_i2c_stm_st33: fix oops when i2c client is unavailable
When no i2c bus exists, user-space can cause an oops by triggering a device probe through a message sent to an i2c "new_device" sysfs entry. Adding a check for a NULL i2c client structure in the probe function closes the hole. This patch also fixes accessing the NULL client struct in the print function call reporting the error. Reported-by: Peter Hüwe <PeterHuewe@gmx.de> Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/char/tpm/tpm_i2c_stm_st33.h')
-rw-r--r--drivers/char/tpm/tpm_i2c_stm_st33.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.h b/drivers/char/tpm/tpm_i2c_stm_st33.h
index 5862d0376bd8..439a43249aa6 100644
--- a/drivers/char/tpm/tpm_i2c_stm_st33.h
+++ b/drivers/char/tpm/tpm_i2c_stm_st33.h
@@ -53,7 +53,6 @@ struct st33zp24_platform_data {
int io_serirq;
int io_lpcpd;
struct i2c_client *client;
- bool bChipF;
u8 *tpm_i2c_buffer[2]; /* 0 Request 1 Response */
struct completion irq_detection;
struct mutex lock;