From patchwork Mon Jul 19 14:50:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 479848 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4204065jao; Mon, 19 Jul 2021 07:58:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw990qBdNq3eR8wC+rXBEfRdtyHlLQwgO5GbS3MsvALFErRx8qspi7PVGbAfnNZdd1cXlG X-Received: by 2002:a02:a999:: with SMTP id q25mr20233453jam.16.1626706739244; Mon, 19 Jul 2021 07:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626706739; cv=none; d=google.com; s=arc-20160816; b=dP7HDHxm5qILdNsFiy28PpCMXbqSJi6Q7opB1nPG0N2M0dE4lhqZbSIecAXhqcdHMD 3dbDXBD0tALMkkVnNNN+uoM3gMr4viUDAVQIcaj9eARkkIQqEOMkDm8g+o3ntVoejqmB BLRMnOZNm4zjNSdplwvEZr9Y0iQimK1m7F9Yadq9FZJ9EglglNF+QHsSrGWrYbfqqjfU ckHwbzTVKjPnCIDjrMC+9Fje6vz5iYoFQXZW0P9aJTO7mmIBzF64ElprgxGFp8HvKYAi Z94ITlyLoEfzRIAV0BhGx3ampHOvqYA5D2Hd9yJrDvxbtiaHC9x5sEDg1K2hm9A4DXIy ednA== 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=37ghzIsQgZ8Ir2ko8eWjuiDUhwsCjJBu1Tr501u+IWo=; b=lMOMjCQzgb8C2k74WTmf0k5MxEcGlvUJbmOdIlryCPSyIYQCpYEKW5Yuc0Vi8q5NN3 mih/qItWXDkGNBVhmEBxjfgCZYl0P7AHJTlBxkLdIppPVuyEZ6sH1nQQU+wiws/DLkYH tehC1ySeA6Di+C9/T4IZ3em78ih2NQCAuboTP+XoSorpYnLMky2UK56qkyGqbC4BCozp 7mkRtHrIapNU2SdrLker84QyUH9kaOAIMEB3P9zEliMRbXyru9EMQpB/H6+lPgv3KXzm K7+qPDrXjGFkfFCuIgOjx/3m6cxrbr23AMMiohxOXYNkK3QGUzlDNgpr1bqQ+HETcYwp Tp8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="FRk/84Mv"; 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 e6si20758588ilm.61.2021.07.19.07.58.59; Mon, 19 Jul 2021 07:58:59 -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="FRk/84Mv"; 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 S242150AbhGSOSQ (ORCPT + 12 others); Mon, 19 Jul 2021 10:18:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:52322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241866AbhGSORs (ORCPT ); Mon, 19 Jul 2021 10:17:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 47336610D2; Mon, 19 Jul 2021 14:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626706707; bh=Od9se7P6b5t9tzBMuTnK51diNUzL5+NLQvhG+sPw61s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FRk/84MvSrm9EflnlMWczkV/+ALIZr3WezhW09FZBtVrz08MhNW2HLQW+Sd+/ctdo W4qYHMVX51rE7dH5oMehFLe8gVg/IHA+Feke0ZmR1+RPJdaPHsSsNyrSa07Ze+34Mi m3pDaFhPrpDAUn+Z4ySLxs8lulVp3/86bmI8nxks= 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.4 063/188] ehea: fix error return code in ehea_restart_qps() Date: Mon, 19 Jul 2021 16:50:47 +0200 Message-Id: <20210719144927.665494745@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144913.076563739@linuxfoundation.org> References: <20210719144913.076563739@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 efe84ca20da7..43fc6d370457 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -2654,10 +2654,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]; @@ -2677,6 +2675,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; } @@ -2689,6 +2688,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; } @@ -2697,6 +2697,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; }