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>
This commit is contained in:
Dan Carpenter 2010-11-13 11:34:16 +03:00 committed by Greg Kroah-Hartman
parent 62af33ec6e
commit a1a26e492c
1 changed files with 1 additions and 1 deletions

View File

@ -460,9 +460,9 @@ static int cp_tm1217_probe(struct i2c_client *client,
for (i = 0; i < TOUCH_SUPPORTED; i++) { for (i = 0; i < TOUCH_SUPPORTED; i++) {
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (input_dev == NULL) { if (input_dev == NULL) {
kfree(ts);
dev_err(ts->dev, dev_err(ts->dev,
"cp_tm1217:Input Device Struct alloc failed\n"); "cp_tm1217:Input Device Struct alloc failed\n");
kfree(ts);
return -ENOMEM; return -ENOMEM;
} }
input_info = &ts->cp_input_info[i]; input_info = &ts->cp_input_info[i];