kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailbox: mtk-cmdq: Fix uninitialized variable in cmdq_mbox_flush()
@ 2021-06-22 13:08 Dan Carpenter
  2021-06-25  9:05 ` Chun-Kuang Hu
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-06-22 13:08 UTC (permalink / raw)
  To: Jassi Brar
  Cc: Matthias Brugger, Yongqiang Niu, Chun-Kuang Hu, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel-janitors

The "cb" pointer needs to be initialized before can assign
"data.data = cb->data;".

Fixes: 4a3cb0303984 ("mailbox: mtk-cmdq: Use mailbox rx_callback")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mailbox: mtk-cmdq: Fix uninitialized variable in cmdq_mbox_flush()
  2021-06-22 13:08 [PATCH] mailbox: mtk-cmdq: Fix uninitialized variable in cmdq_mbox_flush() Dan Carpenter
@ 2021-06-25  9:05 ` Chun-Kuang Hu
  0 siblings, 0 replies; 2+ messages in thread
From: Chun-Kuang Hu @ 2021-06-25  9:05 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jassi Brar, Matthias Brugger, Yongqiang Niu, Chun-Kuang Hu,
	linux-kernel, Linux ARM, moderated list:ARM/Mediatek SoC support,
	kernel-janitors

Hi, Dan:

Dan Carpenter <dan.carpenter@oracle.com> 於 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>

>
> Fixes: 4a3cb0303984 ("mailbox: mtk-cmdq: Use mailbox rx_callback")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-25  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 13:08 [PATCH] mailbox: mtk-cmdq: Fix uninitialized variable in cmdq_mbox_flush() Dan Carpenter
2021-06-25  9:05 ` Chun-Kuang Hu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).