Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1676471pxu; Sun, 6 Dec 2020 03:42:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0OJ3Oz+TgyaOLPu14cuXTJsroQViG/KkVeL6c3y64ZH+w4CYC0Mo8/5p5vu6gMnKy/OCu X-Received: by 2002:a17:906:33c4:: with SMTP id w4mr14217680eja.380.1607254956798; Sun, 06 Dec 2020 03:42:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607254956; cv=none; d=google.com; s=arc-20160816; b=YSaMBhPl+L6xludmy4UBDZlKqCoa+Q7Ecfogl7FZ9WjvlLfgx3Eug6y3zVML8FTGZY DO/JvzPmIMP6AhfDUmItJjTY6O0+6t25BYAI+dMhAxj+qmdMIg1isgTA7X0KR4jUvZrj YBDuk7bdIuJsxta6JlWASBe5VzNyY3oHVXZriC6eqIH9uDk3NnObE3aKQX32oY6fW9gp FY9nmfa9sDAaco8o8ZzBfHLlipAicOMusul7SebY95aX2TtCe8m7zfzuP8IDeyFjZiWN aRS8G67a++WVc3PHeI0OyhLLFqb1NoRgcBlnknO5XpYTeRF/Z6hsib+W+iSJyuEMOpeO jbzw== 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=d4kf6Y/O5b3LPJEFREuWA33OekJOJXSonkqpLfCtAgCqM4QA7O02kiEGV/0LBPeAFa /q9JURf6I7bvAjNnHk6Djz90nIA+lJVesIeSiB3r2KAGwvprOEIjOeqOIp672yRezmnb T89/4scKUbgkQ5Wl+KAiBpkjB0wn9j1gmW5sCbi3BrRNW+FDJkWhpyecIQ+LecmFBZYg lDgVP+D9M6MFMP1ToAQOVdbX+0hKp/1vlAHZTEdb4Bs7E/+LRSjMX+hiADxnc5hWb86o nMyZ3ps0FIAIpOFQQxC78B/9Y4a0LP0tZH16vHkTLq+taIwmKlTJk5nI39z9tbe6GL33 Vykg== 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 me16si4671652ejb.257.2020.12.06.03.42.14; Sun, 06 Dec 2020 03:42:36 -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 S1728024AbgLFLj3 (ORCPT + 99 others); Sun, 6 Dec 2020 06:39:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:35972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727995AbgLFLj2 (ORCPT ); Sun, 6 Dec 2020 06:39:28 -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.14 14/20] net: pasemi: fix error return code in pasemi_mac_open() Date: Sun, 6 Dec 2020 12:17:17 +0100 Message-Id: <20201206111556.225573507@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201206111555.569713359@linuxfoundation.org> References: <20201206111555.569713359@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 */