Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5053390pxu; Thu, 10 Dec 2020 11:42:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOu87BILALWL3TECNjUhwLPQTgli0oLyT49mPU0/asPsRCw1U0+NJqw2M24cdm4Hd+iPVQ X-Received: by 2002:a05:6402:2066:: with SMTP id bd6mr8421415edb.211.1607629321062; Thu, 10 Dec 2020 11:42:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607629321; cv=none; d=google.com; s=arc-20160816; b=uVk0eCbMK3IVxbrPvnAcsQvH858833WgOBJb4LvwG4HqoYrF/S5bqHtzdZtfI+L0Db N2bMWmLZlvd7fd8qj3d8EX3k79dvvhGnBg4L3zZntrygEJX7KyW1u/aSsdHuICuhrfeP jbbs74695eihrV5vTNTRrvLAuAH9Fvt1hGBX6Q7fekVVSkFo3d5I+/odbqq9tEBoIqwg mOCAHqyU+7KZKGCCkMT+ZTTL9Q/EW1EQqzKkVrLHcIHZDCThklCsRNc675CPLgFrFUcs 2RyUdYbj2Q3Vbj/T0ON4cL3IRRnvmyPw++Ms5uv18vW0U0gRhvHln+tfwNpUPD+dbqvG WRtQ== 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=ajfbJ6H1NvMuYUvwvEJCGB/+DWgMomqR4nj0iig7AtfrTQo1v8pES7BJ4Z7M8bT6k2 aMAJFQbIrsrXNrEPN9VW5bCsV5gwlpVUgE5+YXXe0tjHVv+z31ToCpCo0UVchZxmesVL IGDf9+0jVbsFKiKqdpkMpoTg+q9lZ/FXJA2DNYTPH4+4thrThmvx4nOE0vE9Y0KtGiqR 6ylp2rzX+7nmBCLMZGID63OgkeYy7Ze0Fw5YdckSKf/AiyEuIEnA73gP9GgXPqmFCHoy u9fhU7SSrSZXId6Srt2FjjtkyPWzMhwCTW2aZ97ha4eIB9t+X+UqR0ZxU96vWewMkkgC Xe5A== 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 q8si3469019edg.582.2020.12.10.11.41.32; Thu, 10 Dec 2020 11:42:01 -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 S2393466AbgLJThu (ORCPT + 99 others); Thu, 10 Dec 2020 14:37:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:36560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390177AbgLJO2v (ORCPT ); Thu, 10 Dec 2020 09:28:51 -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.9 10/45] net: pasemi: fix error return code in pasemi_mac_open() Date: Thu, 10 Dec 2020 15:26:24 +0100 Message-Id: <20201210142602.874364915@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201210142602.361598591@linuxfoundation.org> References: <20201210142602.361598591@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 */