rtlwifi: Use pr_warn instead of WARN_ONCE
authorDongliang Mu <mudongliangabcd@gmail.com>
Wed, 11 May 2022 01:44:52 +0000 (09:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 14:53:45 +0000 (16:53 +0200)
[ Upstream commit ad732da434a2936128769216eddaece3b1af4588 ]

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 <syzkaller@googlegroups.com>
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220511014453.1621366-1-dzm91@hust.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/realtek/rtlwifi/usb.c

index 4fa4d877f913b6dc7290a20b195d1b92225ac718..c29beb00203c18cfa8992a58b64e4b8430447b6d 100644 (file)
@@ -1060,7 +1060,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;