[Meego-kernel] [PATCH 4/6] cptm1217: avoid deference NULL ts if kzalloc fails

Hong Liu hong.liu
Sat Sep 25 02:24:57 PDT 2010


cptm1217: avoid deference NULL ts if kzalloc fails

Signed-off-by: Hong Liu <hong.liu at intel.com>
---
 drivers/input/touchscreen/clearpad_tm1217.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/clearpad_tm1217.c b/drivers/input/touchscreen/clearpad_tm1217.c
index 6ed1767..bc768dd 100644
--- a/drivers/input/touchscreen/clearpad_tm1217.c
+++ b/drivers/input/touchscreen/clearpad_tm1217.c
@@ -421,7 +421,7 @@ static int cp_tm1217_probe(struct i2c_client *client,
 
 	ts = kzalloc(sizeof(struct cp_tm1217_device), GFP_KERNEL);
 	if (!ts) {
-		dev_err(ts->dev,
+		dev_err(&client->dev,
 			"cp_tm1217: Private Device Struct alloc failed\n");
 		return -ENOMEM;
 	}
-- 
1.7.2.3






More information about the Meego-kernel mailing list