Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6479150iob; Tue, 10 May 2022 20:57:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR5l1tsz7FJZwCRtKaXXq68/QMmKoE0+EZYQa6glFChz8b+39RiTqzvZfP6o5FZDmS+0uv X-Received: by 2002:a17:906:4786:b0:6f9:635f:72a7 with SMTP id cw6-20020a170906478600b006f9635f72a7mr15597626ejc.326.1652241454224; Tue, 10 May 2022 20:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652241454; cv=none; d=google.com; s=arc-20160816; b=POjddIywp5cQ6i1HEmf9IkgzVdSYnqO5x1iU943s7zkKCT0Sgjhs+5yMsbIwggLS6J YAi6OTwf4CSMUzBWAiPpdnu/oVX4KdQqpHlZsrYIrCpNf7iOUTibDT/yO3B5sK37YHh4 ARfKpeGTA5EXywGSHMAS958K2oeTOnzbfX0KAcMg/K94mSbwjpjKJEWFU8Avro+Gtpu1 icuGE+SY2mXsSsFhKn/2xvPsjiXQ0ddkSRlR2EYld7GLMGNwZ9G2cuk6hiFLg4/op8u6 vBDzI/X/ifgHhMkSXgA3vmS2dizALyWG0VW3mBYH95cHGBMe1Gy4094wIgXDwimWQso0 VYLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HPyj9aD1FMRn5/Kttn1zXmx5/MWEpY29JsNrmC1oUUY=; b=jVet2mzknnX1IvCVZ2wkMMkn+ch8wSG2wWrYtK2J7/CBlqJsd4JtapoEpi0zhbtdjB 9valfjxQX2WJcKhDvujcBrtcjLHPKeu5wGpGZaAyDb312Wapmov5rlbrWAI7+ZoAtIA6 SlYAX/0zNwjIyPtF5EQM7c6UEX3R/JuYI7t16j7+kqWsRXE1j29cN42Z8IJKBcx7kJES UeKcB0RZNAqurYLHgjqlr0RhDgRpcoa83nY09tx/9pgAV6NcahCRJHOJBW9rs4btOFGA 5cZ+XzNLxicKAqPtqi9x2d+UzKWdIlF+ih5AcVywwiMk/J7vw1adYUFp7nFswMIg4bV0 pDuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a056402520e00b00418c2b5bea5si1319078edd.391.2022.05.10.20.57.08; Tue, 10 May 2022 20:57:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229584AbiEKBqY (ORCPT + 99 others); Tue, 10 May 2022 21:46:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240637AbiEKBqP (ORCPT ); Tue, 10 May 2022 21:46:15 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEF973586D; Tue, 10 May 2022 18:46:07 -0700 (PDT) Received: from localhost.localdomain ([172.16.0.254]) (user=dzm91@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 24B1isWb014794-24B1isWe014794 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 11 May 2022 09:44:59 +0800 From: Dongliang Mu To: Ping-Ke Shih , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Dongliang Mu , syzkaller , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] net: rtlwifi: Use pr_warn instead of WARN_ONCE Date: Wed, 11 May 2022 09:44:52 +0800 Message-Id: <20220511014453.1621366-1-dzm91@hust.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: dzm91@hust.edu.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dongliang Mu 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 Signed-off-by: Dongliang Mu --- 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