Skip to content

Commit b30376d

Browse files
committed
Merge branch 'at91-4.14-trunk/mxt+fixes' into linux-4.14-at91
2 parents b733e44 + 6635ffb commit b30376d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/input/touchscreen/atmel_mxt_ts.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,10 @@ static void mxt_debug_msg_enable(struct mxt_data *data)
418418

419419
data->debug_msg_data = kcalloc(DEBUG_MSG_MAX,
420420
data->T5_msg_size, GFP_KERNEL);
421-
if (!data->debug_msg_data)
421+
if (!data->debug_msg_data) {
422+
mutex_unlock(&data->debug_msg_lock);
422423
return;
424+
}
423425

424426
data->debug_v2_enabled = true;
425427
mutex_unlock(&data->debug_msg_lock);
@@ -451,6 +453,7 @@ static void mxt_debug_msg_add(struct mxt_data *data, u8 *msg)
451453
mutex_lock(&data->debug_msg_lock);
452454

453455
if (!data->debug_msg_data) {
456+
mutex_unlock(&data->debug_msg_lock);
454457
dev_err(dev, "No buffer!\n");
455458
return;
456459
}
@@ -685,6 +688,9 @@ static int mxt_check_bootloader(struct mxt_data *data)
685688
u8 state;
686689
int ret;
687690

691+
if (!f)
692+
return -EINVAL;
693+
688694
/* Handle interrupt after download/flash process */
689695
if (f->pos >= f->fw->size) {
690696
complete(&f->flash_completion);

0 commit comments

Comments
 (0)