Skip to contentSkip to conversation

ti: wlcore: fix error return code of wl1271_cmd_build_ps_poll()

PATCH In review Jia-Ju Bai 2 participants 2 messages Mar 7, 2021 – Apr 18, 2021

Subsystems (3)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 ti: wlcore: fix error return code of wl1271_cmd_build_ps_poll()

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.

---
 drivers/net/wireless/ti/wlcore/cmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ti/wlcore/cmd.c +3 -1
index 32a2e27cc561..7bf8b8201fdd 100644
@@ -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,
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · 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.

Someone needs to review this.

Patch set to Changes Requested.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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