From patchwork Mon Jul 12 06:09:38 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: 472845 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2644513jao; Sun, 11 Jul 2021 23:24:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsQDqP29DfDWlzzDPMJqtq/d04vDtmCuEYTqnFGoK52y6xPqLDlW9foAcPxx28t2nXutKS X-Received: by 2002:a17:906:a108:: with SMTP id t8mr50753874ejy.407.1626070964372; Sun, 11 Jul 2021 23:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626070964; cv=none; d=google.com; s=arc-20160816; b=RuuQIB8XgEXSAAY8CmPnO3ZEC9hmP2EPueybjlVpdDubTZYtAsl7Y6DuNFn4Bxmb2N K+LlrziLzwKDa5nnX8nm+HPsxK8wYGJyT6+hkd8RLDbSulclkkrgjGM2+FO7FS0fJzOg soBVFJEywv2jMc2NrnT2BYV/m01tPWbccWR/S0oCMYjSM8eJbx7U48/axe/LBhukxPHv OL/YSLX418tU1vSuMt6osOGlVAsbhPrIppcFNMPMGNZP+jTrgnBCRClj6OZGyqdbRF90 oSyu9U718bCzvHng539D2nkY6gi415YbNOlLGv9Sd+QHVv19k7iP7RfdTDncMZ1RFr17 sjZg== 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=tc/XVl249Winp+jT3WA6APNRkUFnHns2vcIY8mKg4mw=; b=Wl7Sizgik1BNj5QFI39m8A+Oqu7oYh2ObJ2HPRfG8DjIxyz6mYAupSSfGpYpI8/w8T HtDwnS33VCniNMqTr3yneEjx8kfH4Q/P/ZozzY4H8BrI1jm5xg3yfc9n4Ae2kasY9Zv4 0INoi6WNgRK/JBHijtHSUJETHs4ehMb87PTlP/ilzoF6ZBmZErWp5LcnyBPcrMF1NI3y /W/n5KrGpwT5bhAFwP+Pw1Msufz9ZNOSk/SAXs8jvykWbrwSxZBNoNuDGcQvr/Ty5t6L iYuoFk1gsmYazH7X5TfMMpgFDIW3Jlm8uYWjmgfFC/nqBDIWWWHf146S7/IwcVYnHkz6 U+yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iyIk2N8b; 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 hg22si15826966ejc.382.2021.07.11.23.22.44; Sun, 11 Jul 2021 23:22:44 -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=iyIk2N8b; 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 S235066AbhGLGZ3 (ORCPT + 12 others); Mon, 12 Jul 2021 02:25:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:45560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235291AbhGLGYn (ORCPT ); Mon, 12 Jul 2021 02:24:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C077D61130; Mon, 12 Jul 2021 06:21:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626070915; bh=VBXp8bkpQKtErkRiT4+CgRLs848UG0QGmGyzaxyX1eQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iyIk2N8beL2uHuIIjIuo51pZWpvcE/F+/FgxPHWcH9Zbdqznds3/nSMNj34UkklyQ Hzgb69WIdrrMjpE4T/Ze5pbHMOTtV7JrmmRf1aWndHoaIk+pkxELFDVPTZwaPQcICy UEDFqKXVrHueNhS/wRBpo6xMR/YoQ2U8uvKz+dT0= 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 5.4 194/348] ehea: fix error return code in ehea_restart_qps() Date: Mon, 12 Jul 2021 08:09:38 +0200 Message-Id: <20210712060726.896919595@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@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 13e30eba5349..1fd2b84e2e91 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -2617,10 +2617,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]; @@ -2640,6 +2638,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; } @@ -2652,6 +2651,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; } @@ -2660,6 +2660,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; }