Thread (2 messages) 2 messages, 2 authors, 2021-06-25

Re: [PATCH] mailbox: mtk-cmdq: Fix uninitialized variable in cmdq_mbox_flush()

From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Date: 2021-06-25 09:06:05
Also in: kernel-janitors, linux-arm-kernel, lkml

Hi, Dan:

Dan Carpenter [off-list ref] 於 2021年6月22日 週二 下午9:09寫道:
The "cb" pointer needs to be initialized before can assign
"data.data = cb->data;".
Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
quoted hunk ↗ jump to hunk
Fixes: 4a3cb0303984 ("mailbox: mtk-cmdq: Use mailbox rx_callback")
Signed-off-by: Dan Carpenter <redacted>
---
 drivers/mailbox/mtk-cmdq-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index 301e65b9527a..67a42b514429 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -455,10 +455,10 @@ static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout)

        list_for_each_entry_safe(task, tmp, &thread->task_busy_list,
                                 list_entry) {
+               cb = &task->pkt->async_cb;
                data.sta = -ECONNABORTED;
                data.data = cb->data;
                data.pkt = task->pkt;
-               cb = &task->pkt->async_cb;
                if (cb->cb)
                        cb->cb(data);

--
2.30.2
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help