Skip to content

Commit cc3eb51

Browse files
Dan CarpenterJassiBrar
authored andcommitted
mailbox: mtk-cmdq: Fix uninitialized variable in cmdq_mbox_flush()
The "cb" pointer needs to be initialized before can assign "data.data = cb->data;". Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Chun-Kuang Hu <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent c0d580c commit cc3eb51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mailbox/mtk-cmdq-mailbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,10 @@ static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout)
455455

456456
list_for_each_entry_safe(task, tmp, &thread->task_busy_list,
457457
list_entry) {
458+
cb = &task->pkt->async_cb;
458459
data.sta = -ECONNABORTED;
459460
data.data = cb->data;
460461
data.pkt = task->pkt;
461-
cb = &task->pkt->async_cb;
462462
if (cb->cb)
463463
cb->cb(data);
464464

0 commit comments

Comments
 (0)