2022-05-11 03:57:34

by Dongliang Mu

[permalink] [raw]
Subject: [PATCH v2] net: rtlwifi: Use pr_warn instead of WARN_ONCE

From: Dongliang Mu <[email protected]>

This memory allocation failure can be triggered by fault injection or
high pressure testing, resulting a WARN.

Fix this by replacing WARN with pr_warn.

Reported-by: syzkaller <[email protected]>
Signed-off-by: Dongliang Mu <[email protected]>
---
v1->v2: change to pr_warn as suggested by Kalle Valo
drivers/net/wireless/realtek/rtlwifi/usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index 86a236873254..a8eebafb9a7e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -1014,7 +1014,7 @@ int rtl_usb_probe(struct usb_interface *intf,
hw = ieee80211_alloc_hw(sizeof(struct rtl_priv) +
sizeof(struct rtl_usb_priv), &rtl_ops);
if (!hw) {
- WARN_ONCE(true, "rtl_usb: ieee80211 alloc failed\n");
+ pr_warn("rtl_usb: ieee80211 alloc failed\n");
return -ENOMEM;
}
rtlpriv = hw->priv;
--
2.25.1



2022-05-13 09:04:01

by Kalle Valo

[permalink] [raw]
Subject: Re: [v2] rtlwifi: Use pr_warn instead of WARN_ONCE

Dongliang Mu <[email protected]> wrote:

> From: Dongliang Mu <[email protected]>
>
> This memory allocation failure can be triggered by fault injection or
> high pressure testing, resulting a WARN.
>
> Fix this by replacing WARN with pr_warn.
>
> Reported-by: syzkaller <[email protected]>
> Signed-off-by: Dongliang Mu <[email protected]>

Patch applied to wireless-next.git, thanks.

ad732da434a2 rtlwifi: Use pr_warn instead of WARN_ONCE

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

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