From patchwork Mon Jul 12 06:07:52 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: 472956 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2675753jao; Mon, 12 Jul 2021 00:13:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYcbDk4CdoQRJQZhXbIEfBAtsiT4HqQ//DSg1RHjEoxrlO2d3mgKB3KsjT/XGqHNLrxf72 X-Received: by 2002:aa7:d3da:: with SMTP id o26mr34925503edr.304.1626073985289; Mon, 12 Jul 2021 00:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626073985; cv=none; d=google.com; s=arc-20160816; b=KF2bkM559WDmIhc2419cNoSgayZl2ubeHJH1YKHXOMUXAeW7w0TE+gRJoEmDBJCkXn nVicrZmm71xmxrLtu7bCPa8vLcM2NY/2peRYwfUJQgBcb6ZVrNy2JNXwV9w3Uihs7cVJ 9oaqdZRD3Q1nv5kb98u7EntQfVAVIt0uHQcuvfQdcHr2QfUoHJk2mwOWt07rtJZpo0NG msRivlUHZ4+rMnhR2RBBj7ZORLjgVnVaFLHRQTkK1yVJabFhM9eODrrOeUxLUx8NClpS 33EBK6JEqc4mx1+Xv6utDiq11uTAQzxkHXZUBEqmoIPKA+l31A1rf9PtavpoY+l908/S HbPw== 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=95kxd0fjP71jV6AwBGa2bO6l9rAnVRvBOBmYhaJzJYQ=; b=d070mW5ftdgmiq9HiCtv7jRMQeqZb202euF1xfBs5t54qFHE65HrKJIewZqcrBdPm2 zxQDU+BCCBWZLngV1YEHaKPEtRBbPoaPXEGOZc9YM1oXNHp38m4E1vFa7cgnq972lzRw umv9wDLW99SMupJiYVWkCAwYU/D10h9DUmEFK2vVNr329NpwdDx5GUHXeYhR8n97Nxx/ OepWq/QEfhymKRqOSnFFqQz3t+8c5wbgUQSfu4wfTNXMJjrd2Ns5RL1wn0tvrj1fEF4H NLdBMHiDDHY1Hrh4Jvv9QicRlWYHsIAMGpMvYhd1RxNrPYnGasKbnl2TuViDDfBouPNb TsnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XYhUYgHU; 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 q13si16172370edd.111.2021.07.12.00.13.05; Mon, 12 Jul 2021 00:13:05 -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=XYhUYgHU; 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 S243493AbhGLHPs (ORCPT + 12 others); Mon, 12 Jul 2021 03:15:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:48836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241517AbhGLHOk (ORCPT ); Mon, 12 Jul 2021 03:14:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5A17613E6; Mon, 12 Jul 2021 07:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626073882; bh=MCwjGlUhMs9fRJNOMQKclYgS0+8CWreKuf7GuCiuqT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XYhUYgHUpBlYrDjxJUt4kcVZ8tP+i49eUdLj/ldgVJPT4enAN8Ctbkgmts59P9lrG ntpoFDL3WUhOwmmlZG2PzGm2HkN1xuV2RvgogdJCS1y945Rq99jbOQ1g6n1lhMmD5l kixD9+CjV0IIov2tZ08N0hqgsnCw2c+sHN/iog8s= 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.12 389/700] ehea: fix error return code in ehea_restart_qps() Date: Mon, 12 Jul 2021 08:07:52 +0200 Message-Id: <20210712061017.785496687@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@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 c2e740475786..f63066736425 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; }