]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/cptm1217/clearpad_tm1217.c
drivers/staging/cptm1217/clearpad_tm1217.c: Correct call to input_free_device
[mv-sheeva.git] / drivers / staging / cptm1217 / clearpad_tm1217.c
index 76e4b782d2fb93fbf993652189fa8d255264ebb7..5456f82c30660d72259b02226c30ca61b09fb983 100644 (file)
@@ -52,7 +52,7 @@
 #define TMA1217_DEV_STATUS             0x13    /* Device Status */
 #define TMA1217_INT_STATUS             0x14    /* Interrupt Status */
 
-/* Controller can detect upto 2 possible finger touches.
+/* Controller can detect up to 2 possible finger touches.
  * Each finger touch provides  12 bit X Y co-ordinates, the values are split
  * across 2 registers, and an 8 bit  Z value */
 #define TMA1217_FINGER_STATE           0x18 /* Finger State */
@@ -462,8 +462,8 @@ static int cp_tm1217_probe(struct i2c_client *client,
                if (input_dev == NULL) {
                        dev_err(ts->dev,
                                "cp_tm1217:Input Device Struct alloc failed\n");
-                       kfree(ts);
-                       return -ENOMEM;
+                       retval = -ENOMEM;
+                       goto fail;
                }
                input_info = &ts->cp_input_info[i];
                snprintf(input_info->name, sizeof(input_info->name),
@@ -486,6 +486,7 @@ static int cp_tm1217_probe(struct i2c_client *client,
                        dev_err(ts->dev,
                                "Input dev registration failed for %s\n",
                                        input_dev->name);
+                       input_free_device(input_dev);
                        goto fail;
                }
                input_info->input = input_dev;