From: Devendra Naga Date: Fri, 2 Jan 2015 18:17:06 +0000 (-0500) Subject: cptm1217: check if interrupts are masked at probe X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=60c47c62f012b4f551132374e37e4f93a9596107;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Devendra Naga Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/cptm1217/clearpad_tm1217.c b/drivers/staging/cptm1217/clearpad_tm1217.c index 7f265ce0dd13..43046049830c 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);