diff --git a/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x_generic.c b/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x_generic.c index d1ba7b88204e..cbb9367c67b0 100644 --- a/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x_generic.c +++ b/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x_generic.c @@ -106,7 +106,7 @@ static ssize_t gt1x_debug_read_proc(struct file *file, char __user * page, size_ { char *ptr = page; char temp_data[GTP_CONFIG_MAX_LENGTH] = { 0 }; - int i; + int i, ret = -1; if (*ppos) { return 0; @@ -136,7 +136,9 @@ static ssize_t gt1x_debug_read_proc(struct file *file, char __user * page, size_ /* Touch PID & VID */ ptr += sprintf(ptr, "==== GT1X Version Info ====\n"); - gt1x_i2c_read(GTP_REG_VERSION, temp_data, 12); + ret = gt1x_i2c_read(GTP_REG_VERSION, temp_data, 12); + if (ret < 0) + return ret; ptr += sprintf(ptr, "ProductID: GT%c%c%c%c\n", temp_data[0], temp_data[1], temp_data[2], temp_data[3]); ptr += sprintf(ptr, "PatchID: %02X%02X\n", temp_data[4], temp_data[5]); ptr += sprintf(ptr, "MaskID: %02X%02X\n", temp_data[7], temp_data[8]); diff --git a/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x_update.c b/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x_update.c index b3de6b6ec123..cb9415087e69 100644 --- a/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x_update.c +++ b/drivers/amlogic/input/touchscreen/goodix_gt1x/gt1x_update.c @@ -515,6 +515,7 @@ int gt1x_update_prepare(char *filename) retry = 5; while (retry > 0) { + retry--; update_info.buffer = (u8 *) kzalloc(1024 * 4, GFP_KERNEL); if (update_info.buffer == NULL) { GTP_ERROR("Alloc %d bytes memory fail.", 1024 * 4);