Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1678448pxu; Sun, 6 Dec 2020 03:47:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNxfMWNe3PjliOWa/bDzp1B3qV/3TNv8YNCrjAMOQXu+SpqAX4bgWJk8ceYMhJDoCD+q28 X-Received: by 2002:a50:ee11:: with SMTP id g17mr6495903eds.259.1607255238931; Sun, 06 Dec 2020 03:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607255238; cv=none; d=google.com; s=arc-20160816; b=pTF+Y+eEZZyyFP6OnK+JmhLOlbvtvIbKH6XacXMVWzQwQflNKYxbfMGldzWstbUmPR jzDiiyTu8QKCKdMdLWbcp0D/4cxjdbS3Z/4mIfzPKkoxbk9WVeyJ+elinapyaRye8r/l s8AMRu+AVEocstb0IVDIcpfnSP48egxpP7Mt0LVgAidqU4i+kaxIPwrhg8bQPWAOFEnL izXgWSWZSQWV8FvFfy5hcCM40JaY7D+JUdTq/VAOzvI2aorSdamuJWB/Rd6nbK2q7rZF bULkTaM4HHlmnIwo+g4XxO1yv2Gy9ixEJRj9OgRSgCc0xYfwq1ooQxTlYWo5U35Kb/Ho o3DQ== 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; bh=bxMK28AQOKAWL9ChfPzXFvEH9PTgrbB9FMTqRrdZsTg=; b=vkuoh98VR17smaqO/MkCzYucA/f0law7uaqbQnSXecSOHXWLxgtfgxMMRm3Un1QvTy UAAUGTLHzx24C7h7TckP52Mc2KmJxK/AUtARkRPM4lmVUu3a4zoRhUsaYuPdlYQIl2OZ dj1Pk860eR3cs+vHecjEBAXLkYziB2eizlyZCcAFIx3/+huSnMgUkT2WLdnTOPEZtrBi aCqpKLVWciti7N4cwkBqo098xOwoVaIEIvoXLJ/ShgYjGdqQ/eL5I+rLabkFp49GH6/w hJa7UrYt3AcrVbU5Jo2vQzTdkj1qg6ebn3hJN2D8cndLN6Ynm+WFjKeaeq+gPLnKpC5w 3G6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si6469254edj.521.2020.12.06.03.46.56; Sun, 06 Dec 2020 03:47:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729043AbgLFLm4 (ORCPT + 99 others); Sun, 6 Dec 2020 06:42:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:42148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727702AbgLFLmy (ORCPT ); Sun, 6 Dec 2020 06:42:54 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Changzhong , Jakub Kicinski Subject: [PATCH 5.4 26/39] net: pasemi: fix error return code in pasemi_mac_open() Date: Sun, 6 Dec 2020 12:17:30 +0100 Message-Id: <20201206111555.935076667@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201206111554.677764505@linuxfoundation.org> References: <20201206111554.677764505@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Changzhong [ Upstream commit aba84871bd4f52c4dfcf3ad5d4501a6c9d2de90e ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 72b05b9940f0 ("pasemi_mac: RX/TX ring management cleanup") Fixes: 8d636d8bc5ff ("pasemi_mac: jumbo frame support") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong Link: https://lore.kernel.org/r/1606903035-1838-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/pasemi/pasemi_mac.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/pasemi/pasemi_mac.c +++ b/drivers/net/ethernet/pasemi/pasemi_mac.c @@ -1078,16 +1078,20 @@ static int pasemi_mac_open(struct net_de mac->tx = pasemi_mac_setup_tx_resources(dev); - if (!mac->tx) + if (!mac->tx) { + ret = -ENOMEM; goto out_tx_ring; + } /* We might already have allocated rings in case mtu was changed * before interface was brought up. */ if (dev->mtu > 1500 && !mac->num_cs) { pasemi_mac_setup_csrings(mac); - if (!mac->num_cs) + if (!mac->num_cs) { + ret = -ENOMEM; goto out_tx_ring; + } } /* Zero out rmon counters */