[PATCH] cptm1217: check if interrupts are masked at probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Cc: Ramesh Agarwal <ramesh.agarwal@xxxxxxxxx>
Signed-off-by: Devendra Naga <devendra.aaru@xxxxxxxxx>
---

 build tested only on x86_64. config is allmodconfig.

 drivers/staging/cptm1217/clearpad_tm1217.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/cptm1217/clearpad_tm1217.c b/drivers/staging/cptm1217/clearpad_tm1217.c
index 7f265ce..54e5953 100644
--- a/drivers/staging/cptm1217/clearpad_tm1217.c
+++ b/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);
-- 
1.9.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux