Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1677287pxu; Sun, 6 Dec 2020 03:44:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFo9J07lGkRYd3THJimH+TSHK6jajLAjtU86F82zWPdy3OAlt/kGjPvoGH/1Q1jJnRLIm7 X-Received: by 2002:aa7:d6c9:: with SMTP id x9mr15105536edr.96.1607255078709; Sun, 06 Dec 2020 03:44:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607255078; cv=none; d=google.com; s=arc-20160816; b=o7LbBC326fyKxTVRp00vFeZtQQTSnYTg2Ojf/Au3L6HpJ+EgPSFq7IYXYzY7BuPHxY i8FY6s4rXLS24oEmjKyzSMFFCqEGaNR33AHMSNIMBQWHG8RUov2TIb7pmim8P2FP8tSZ 7q1uXUCYNqivbKPp7e8Rkcv5rK49Ex1/9huyHbcUzSJjgXjjQryQg8jpnh567Jcnwzr0 zMMv3dXZqCsoU1wPftPLaWcLpo/atArzNUTZYXEzH+e3VAtZYH0W1vf3kF2XKMdP9yZh 9W1mF2818dzcVKMtqXB33fkEJPqodbKmsp3yjnCjkM1TcnmBeGZBxGx907MRnhhh3Sgn V1Uw== 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=zHAKn9UF9RjTLEMIUNe/1JbjwFLjKXMK7RkbDDhvlZ0=; b=bdPZXzIef57JsWrcYEgIzhzGHzJJSMX2rviKWXVe3KIY5SPRD4Cr+YpDZIhQJPDfEK Ck77nDinGxEqxI8JXwy4NE6HCrkUjfalw9DMnYzvB/18jtUiYD6aTZVQ0vFt5FuU1RgW TE6Lb45d+KAnq6TQ10flFhoFGphTB+JNTYY39A7v55Ek7tN97rhGDa23WobMY4ryxZUU hxafeA6typzuI19NpdzArvw3wIwO7qiW+Bqb1E4KN/T44lmi9MBMXqWKMwvQrWtRgqqk j2nKb0kiyg7QV1FjfTblxrErBNtQqBDjjRkNDXmYa/i1TPoLn7gI2r3qEZIFjto5bjVM 05Jw== 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 cz27si351626edb.371.2020.12.06.03.44.16; Sun, 06 Dec 2020 03:44:38 -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 S1728688AbgLFLko (ORCPT + 99 others); Sun, 6 Dec 2020 06:40:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:37526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728675AbgLFLkl (ORCPT ); Sun, 6 Dec 2020 06:40:41 -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 4.19 22/32] net: pasemi: fix error return code in pasemi_mac_open() Date: Sun, 6 Dec 2020 12:17:22 +0100 Message-Id: <20201206111556.832859190@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201206111555.787862631@linuxfoundation.org> References: <20201206111555.787862631@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 @@ -1089,16 +1089,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 */