瀏覽代碼

cptm1217: check if interrupts are masked at probe

the function cp_tm1217_mask_interrupt can return failure.
added the check and the failure path.

Cc: Ramesh Agarwal <ramesh.agarwal@intel.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Devendra Naga 10 年之前
父節點
當前提交
60c47c62f0
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      drivers/staging/cptm1217/clearpad_tm1217.c

+ 6 - 0
drivers/staging/cptm1217/clearpad_tm1217.c

@@ -446,6 +446,12 @@ static int cp_tm1217_probe(struct i2c_client *client,
 
 	/* Mask all the interrupts */
 	retval = cp_tm1217_mask_interrupt(ts);
+	if (retval) {
+		dev_err(ts->dev, "failed to mask interrupts, error: %d\n",
+			retval);
+		kfree(ts);
+		return retval;
+	}
 
 	/* Read the controller information */
 	cp_tm1217_init_data(ts);