Skip to contentSkip to conversation

Staging: cptm1217: move free under dereference

PATCH In review Dan Carpenter 2 participants 2 messages Nov 13, 2010 – Nov 16, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: cptm1217: move free under dereference

We dereference "ts" in the printk so move the kfree() down a line.

drivers/staging/cptm1217/clearpad_tm1217.c +1 -1
index 269503f..76e4b78 100644
@@ -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];