Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3086605rwe; Mon, 29 Aug 2022 05:43:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR7kAtNI3gYnjlkwyB62ovUk4keqhJXaEo1QBmaeepbPchF1IP/YyagYQxRJAYqtGJdIIrF2 X-Received: by 2002:a17:902:7602:b0:172:a064:4a2f with SMTP id k2-20020a170902760200b00172a0644a2fmr15997502pll.56.1661777017407; Mon, 29 Aug 2022 05:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661777017; cv=none; d=google.com; s=arc-20160816; b=CcLcips2jVOx6pLLMGTLfGFEzNgru4hFCG1rb3lwNgaAyXJA8VASjBu3cdQV5XK9uA JHupSITI5KIp8RkBch80dv3r27mVKrnPwbb+LagW1cxVydQYrSrnhO8XK9pF8wj8nh0b jnDxUOFZf6viTa8u4BpRE1AQaQ6M32M4CDzWKu1LWRXItQp6kIySShDQNqUc1y5tb7qM Ze76r5iYFWMn2ZyyA21Sfe2qpjWEAsfgDIWnbyB6BaWsNO8Eg7yr3EjtWPl0Se9AUDyg k8Dkww5Llv/1mVR/M6UpjPMxLCjLIibC/GnZtEowOpiqIIYBVtBvI3644kFDPT4Dx6QP WJmw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WbKdkvI5ao6rW/UZSTFAHOx/IgGbo/inoD2aUwa5PSA=; b=BIM6S9JLXBlGf/v4FjSiVEY2Ps94qR2d7Kj1GxfAbxxFCocKh+8DDl8J0RTEs5IJ7n TX8wJewqkH/kI9kPR/I2ShYMGhwju5DP9Gu4FHxFy+raycUq59/0f4kSt1usryS2sfFs 321e3eMHA1R0wot0W6KuW0fMseLP2anSXyoHJeccbn3bF2w2SvB/KNz6LJ6sVbqAAmmB z4towgMeQV0z2xGp9fLleGt+EdkP/dvo+LjuTGxm3WT8UUBkEf0dvdVNwa3wEOpFffAf uOKTtcHQ2UHO19VaG71ZA0RXx+yrQBCmnmKDoSbw0QmMlY3Agey5j26dTVLWgmnINVpS oBdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GLFPljBT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a170902b10700b001713c1ffb4esi8766885plr.322.2022.08.29.05.43.25; Mon, 29 Aug 2022 05:43:37 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GLFPljBT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231347AbiH2M2K (ORCPT + 99 others); Mon, 29 Aug 2022 08:28:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiH2M1w (ORCPT ); Mon, 29 Aug 2022 08:27:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83DCEAE207; Mon, 29 Aug 2022 05:11:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7D81761245; Mon, 29 Aug 2022 11:16:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66BFCC433D6; Mon, 29 Aug 2022 11:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771768; bh=JHEcHOHuYKv5fpWgw5Eb1DRF51P3IYRI0HKX1wpe9Js=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GLFPljBTBqyLDkb0uC8Uk8Q84pS9q8+nAQsxR3eJXAWktuygKYMmIAdPJ3Zvw2EcT 0w1K3QNSEMtqO7l93912NvVCYKTcartL8DykjbeQMPCPeZEz1utF5KRQ1UsHHZxqa/ ZkRFbCqD4+BmiD3biyEECoUaq7v4Ydhc5UBXtNTM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aleksander Jan Bajkowski , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.19 092/158] net: lantiq_xrx200: fix lock under memory pressure Date: Mon, 29 Aug 2022 12:59:02 +0200 Message-Id: <20220829105812.921874621@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105808.828227973@linuxfoundation.org> References: <20220829105808.828227973@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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: Aleksander Jan Bajkowski [ Upstream commit c4b6e9341f930e4dd089231c0414758f5f1f9dbd ] When the xrx200_hw_receive() function returns -ENOMEM, the NAPI poll function immediately returns an error. This is incorrect for two reasons: * the function terminates without enabling interrupts or scheduling NAPI, * the error code (-ENOMEM) is returned instead of the number of received packets. After the first memory allocation failure occurs, packet reception is locked due to disabled interrupts from DMA.. Fixes: fe1a56420cf2 ("net: lantiq: Add Lantiq / Intel VRX200 Ethernet driver") Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/lantiq_xrx200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c index 89314b645c822..25adce7f0c7c0 100644 --- a/drivers/net/ethernet/lantiq_xrx200.c +++ b/drivers/net/ethernet/lantiq_xrx200.c @@ -294,7 +294,7 @@ static int xrx200_poll_rx(struct napi_struct *napi, int budget) if (ret == XRX200_DMA_PACKET_IN_PROGRESS) continue; if (ret != XRX200_DMA_PACKET_COMPLETE) - return ret; + break; rx++; } else { break; -- 2.35.1