Skip to content

Commit

Permalink
rtlwifi: Use pr_warn instead of WARN_ONCE
Browse files Browse the repository at this point in the history
[ Upstream commit ad732da ]

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>
  • Loading branch information
mudongliang authored and gregkh committed Jun 9, 2022
1 parent eb7a71b commit f9413b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/realtek/rtlwifi/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,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;
Expand Down

0 comments on commit f9413b9

Please sign in to comment.