From patchwork Mon Jul 12 06:07:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 473023 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2702617jao; Mon, 12 Jul 2021 00:54:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyfx+QQ3GF6KPE4U1dfcSpn9ePehw+YGDn8VmTIQA87jNo9GuLWhYWNlF3rvo0Zp9nY1RZ X-Received: by 2002:a50:d64a:: with SMTP id c10mr65167146edj.199.1626076482926; Mon, 12 Jul 2021 00:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626076482; cv=none; d=google.com; s=arc-20160816; b=LA/GW0Ce8b1YJlxoNgy5PnilFovxvpQob/v8UptzY8vS8z1f67LNtnNK1l82AoqU+/ SrTqtJCn1BNnVT0+C7AhDpW9FfAie0CXdkFuj5k59N6CUbLlZa9zuIu+v3SRSpfqAdSl +2Nxp/LMJTwcaE4ZLXdMoagjsJ1OmU+EaU+zKgsB38nchFYN9HeHh4ae8oBfU2d5tzQ1 XhEeRklLrsASw6ZuXvzWAZNM3R7EbJyOlHzfz6e7rFaST+W3sqBkBFv8Up3uuvkWyjgq DrJe6bjQXF6j4hPl2bPZc/lTao8R3f45mAuTzyhz4ZNfPRn6okvq+yyNx0kzO1HpKy7u lpKQ== 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=jdT8pifrU0IBcXg0sCobJz9V3jdHsfV+EDaiHCwLRg4=; b=jjuVLUiQHEBOk3tYfSRlCZMNcXeuW3xJRpSCfRZVYXaMr5jEw/M9gE0+tVE32qkEtw 9wfhPl6B7cPpzpwBHI36pU/oCIiNFGiMI5QoJqS+TrmymVT0tFcM1wl9iOLeviBnQC6V eU4+qsPnPP9UI/gmUmoxfP7Oe0NSG6XpVxrIm5CrFGL1pgF3xmIA6t21QHHNCKps6qU7 hkE/ryL/OBDnFQsFeGiPT32wKWmpXywAbk1jQ9jZivumsaKvFISbxBNFjD54aZBSh/cz w3EZwWZGQgjsLfs4z9qfKyCkecks4od4G0qkxvPu0tQQH3r091GyIl2RfkkzirWEb+gY fnNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YyRNdFyD; 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 n21si13642925eda.13.2021.07.12.00.54.42; Mon, 12 Jul 2021 00:54:42 -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=YyRNdFyD; 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 S239159AbhGLHzL (ORCPT + 12 others); Mon, 12 Jul 2021 03:55:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:35482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350502AbhGLHvE (ORCPT ); Mon, 12 Jul 2021 03:51:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E55BD619D4; Mon, 12 Jul 2021 07:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626075950; bh=Pt7eBWdqrvNBJ79+B11Hry5bKq0TZlBclvPZVYmnRL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YyRNdFyD7uPrI/sbb8b9tSBgzEfN3KJX+5tsfeQ0gGu2wsY9LKPNpF6VA+1401YJN 7h521ZwPshPxdj4D6qgPpJvCQLALIOEzuJj0X4dKb0F03RXPTOh+YFPzfqb/IAGDzY +ixqxXa/bJnKsEY5RXsSEVOL9D39jfhfxRR4fJXs= 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.13 435/800] ehea: fix error return code in ehea_restart_qps() Date: Mon, 12 Jul 2021 08:07:38 +0200 Message-Id: <20210712061013.346026361@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060912.995381202@linuxfoundation.org> References: <20210712060912.995381202@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 ea55314b209d..d105bfbc7c1c 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -2618,10 +2618,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]; @@ -2641,6 +2639,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; } @@ -2653,6 +2652,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; } @@ -2661,6 +2661,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; }