linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ti: wlcore: fix error return code of wl1271_cmd_build_ps_poll()
@ 2021-03-07  8:29 Jia-Ju Bai
  2021-04-18  5:55 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2021-03-07  8:29 UTC (permalink / raw)
  To: kvalo, davem, kuba, lee.jones, colin.king
  Cc: linux-wireless, netdev, linux-kernel, Jia-Ju Bai

When ieee80211_pspoll_get() returns NULL to skb, no error return code of
wl1271_cmd_build_ps_poll() is assigned.
To fix this bug, ret is assigned with -ENOMEM in this case.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 drivers/net/wireless/ti/wlcore/cmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 32a2e27cc561..7bf8b8201fdd 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -1120,8 +1120,10 @@ int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif,
 	int ret = 0;
 
 	skb = ieee80211_pspoll_get(wl->hw, vif);
-	if (!skb)
+	if (!skb) {
+		ret = -ENOMEM;
 		goto out;
+	}
 
 	ret = wl1271_cmd_template_set(wl, wlvif->role_id,
 				      CMD_TEMPL_PS_POLL, skb->data,
-- 
2.17.1


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

* Re: [PATCH] ti: wlcore: fix error return code of wl1271_cmd_build_ps_poll()
  2021-03-07  8:29 [PATCH] ti: wlcore: fix error return code of wl1271_cmd_build_ps_poll() Jia-Ju Bai
@ 2021-04-18  5:55 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2021-04-18  5:55 UTC (permalink / raw)
  To: Jia-Ju Bai
  Cc: davem, kuba, lee.jones, colin.king, linux-wireless, netdev,
	linux-kernel, Jia-Ju Bai

Jia-Ju Bai <baijiaju1990@gmail.com> wrote:

> When ieee80211_pspoll_get() returns NULL to skb, no error return code of
> wl1271_cmd_build_ps_poll() is assigned.
> To fix this bug, ret is assigned with -ENOMEM in this case.
> 
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>

Someone needs to review this.

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210307082906.20950-1-baijiaju1990@gmail.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2021-04-18  5:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07  8:29 [PATCH] ti: wlcore: fix error return code of wl1271_cmd_build_ps_poll() Jia-Ju Bai
2021-04-18  5:55 ` Kalle Valo

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).