Skip to content

Commit

Permalink
Staging: cptm1217: move free under dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Nov 16, 2010
1 parent 62af33e commit a1a26e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/cptm1217/clearpad_tm1217.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit a1a26e4

Please sign in to comment.