summaryrefslogtreecommitdiff
path: root/drivers/staging/cptm1217
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-11-13 11:34:16 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2010-11-16 12:31:49 -0800
commita1a26e492c4a90466cb3e064ccf69db4dd66d63a (patch)
tree2b2a7cf04154c05d080a377d5c28164f1e6d2e22 /drivers/staging/cptm1217
parent62af33ec6e73d658720ea1190861c8c0609a94b3 (diff)
Staging: cptm1217: move free under dereference
We dereference "ts" in the printk so move the kfree() down a line. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/cptm1217')
-rw-r--r--drivers/staging/cptm1217/clearpad_tm1217.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/cptm1217/clearpad_tm1217.c b/drivers/staging/cptm1217/clearpad_tm1217.c
index 269503f9516f..76e4b782d2fb 100644
--- a/drivers/staging/cptm1217/clearpad_tm1217.c
+++ b/drivers/staging/cptm1217/clearpad_tm1217.c
@@ -460,9 +460,9 @@ static int cp_tm1217_probe(struct i2c_client *client,
for (i = 0; i < TOUCH_SUPPORTED; i++) {
input_dev = input_allocate_device();
if (input_dev == NULL) {
- kfree(ts);
dev_err(ts->dev,
"cp_tm1217:Input Device Struct alloc failed\n");
+ kfree(ts);
return -ENOMEM;
}
input_info = &ts->cp_input_info[i];