From patchwork Mon Jul 19 14:49:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 479892 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4225418jao; Mon, 19 Jul 2021 08:21:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnh9UEDEdI0hO0zaDbiKt3TukxH2KNYjkG7JmQdpth4SrIghEIqPYfw7wc5akKAQcstzcg X-Received: by 2002:a17:906:a2d7:: with SMTP id by23mr27289119ejb.382.1626708084999; Mon, 19 Jul 2021 08:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626708084; cv=none; d=google.com; s=arc-20160816; b=uRZ1dtjqPAX8ztcZm2awFMZMNTYsTEfYyh7zxS0LP0TFL67wh5rV545F8Kf3pgkWxO 5uAVRMDkBK10uTo7cl6rVwa9eM52Zwx60aAr2LfhUnoBV3z8k9nJw3KBf1W+W8RgWqq7 vrD+H9Zam2yR9nwYNmQ+6O3fivHO7c03t0ohcsTHtMSCBJkkbKoIvO78F7NK0+PIvSOY sXELfBuV7k0G3jDLoLNdH00kSStK+0aq7G4dSNUcJsGROEkwT0CCF8whfsbY4zNtA+JN lqmgmWxNhBnRivi85TNaxYtobeDAg8gCyBG1BvwcWU4uLBpguDkInU3wqziHaYyvoupU x6uA== 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=VLxv9vh5H186ZgCsl7F4ZfSqaaXzjzf/ahPsZlJvHbA=; b=LgoUQVMoQdBb4HyHGeyId8B5DsnMv2C/IG/B1eEgltRTVsD9MXE1Bkrr4r2QYLjWRH 7OIeJqFMkLb1LLNWbFzC5FS/UHf+gXnksDSLY2ysj+6hS0oLtfZIInSpJf5Ro0LbX9KL 2OHidZFwWutC7OObppqnGF4kCPPaIPbKR5e6oBuvN+b8XZEHAb4+YMUJkufNsr0wBQ3H v9xq/8FFmlw9PSK4PzPjl3M+ISZwNhmzqq66sEMzqZ7jcpVsBY8eZqZJngO5WEQgCwp0 w0gs7esxAmorc2usSTN6AVrABcUVvpY3S1XfDHWWPaX9fzPXz2ksmYdHi8tFyIr59tcZ YJfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t8RzVChY; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (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 l3si24719878ejo.634.2021.07.19.08.21.24; Mon, 19 Jul 2021 08:21:24 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t8RzVChY; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S243118AbhGSOka (ORCPT + 12 others); Mon, 19 Jul 2021 10:40:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:54384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244262AbhGSOjN (ORCPT ); Mon, 19 Jul 2021 10:39:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F031561285; Mon, 19 Jul 2021 15:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626707893; bh=ab6FQ0oyXXk/p6gdcqEThgIh3Vh11d4Kx0nxeVLiCJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t8RzVChYitqO5aQBNy55P1RDSergpKmNAXnXyq305lAkW2ywVBuM29dezFFxucAwv +QXm/F0eED3Ap1T0aai3mtlWs3Iq8WmpzEb5wUb+VMb+8xTpQsq57hdPyRT9h6vlG5 HH8PL3LZAH/6O6pNoh/Ojm223hCdIPVk1C0nPjr8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhen Lei , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.14 098/315] ehea: fix error return code in ehea_restart_qps() Date: Mon, 19 Jul 2021 16:49:47 +0200 Message-Id: <20210719144946.103842527@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.861561397@linuxfoundation.org> References: <20210719144942.861561397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zhen Lei [ Upstream commit 015dbf5662fd689d581c0bc980711b073ca09a1a ] Fix to return -EFAULT from the error handling case instead of 0, as done elsewhere in this function. By the way, when get_zeroed_page() fails, directly return -ENOMEM to simplify code. Fixes: 2c69448bbced ("ehea: DLPAR memory add fix") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210528085555.9390-1-thunder.leizhen@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ehea/ehea_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.30.2 diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 373deb247ac0..a754e2ce7730 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -2647,10 +2647,8 @@ static int ehea_restart_qps(struct net_device *dev) u16 dummy16 = 0; cb0 = (void *)get_zeroed_page(GFP_KERNEL); - if (!cb0) { - ret = -ENOMEM; - goto out; - } + if (!cb0) + return -ENOMEM; for (i = 0; i < (port->num_def_qps); i++) { struct ehea_port_res *pr = &port->port_res[i]; @@ -2670,6 +2668,7 @@ static int ehea_restart_qps(struct net_device *dev) cb0); if (hret != H_SUCCESS) { netdev_err(dev, "query_ehea_qp failed (1)\n"); + ret = -EFAULT; goto out; } @@ -2682,6 +2681,7 @@ static int ehea_restart_qps(struct net_device *dev) &dummy64, &dummy16, &dummy16); if (hret != H_SUCCESS) { netdev_err(dev, "modify_ehea_qp failed (1)\n"); + ret = -EFAULT; goto out; } @@ -2690,6 +2690,7 @@ static int ehea_restart_qps(struct net_device *dev) cb0); if (hret != H_SUCCESS) { netdev_err(dev, "query_ehea_qp failed (2)\n"); + ret = -EFAULT; goto out; }