From patchwork Mon Jul 19 14:50:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 479863 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4214531jao; Mon, 19 Jul 2021 08:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwip80ppNMIQMI4ruoaR7+e0Wz6Q+iUcdCNAdY+rM8ThcUherPKow1kahU1xIP/uwRhApm1 X-Received: by 2002:aa7:d98d:: with SMTP id u13mr35586727eds.238.1626707323604; Mon, 19 Jul 2021 08:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626707323; cv=none; d=google.com; s=arc-20160816; b=sW2oykpmBnAQwaoNJFIhR8uS6ur+WLkaFAe1zmv8Q0HwPAAGacSPbPju+rAKzjcOfx SVpgNpudRfVICWoATZAIaI+eqjLyrtQy7cLm+6ICe/MhW/3mwA2R0LwZMFL+DfY6yHNl RjTX1a03mrIDwH3s6igIMJlWMxMO5Lvw8mJcoJbFxhYaS8PRrsk49//vyKnYVUw3QNqi EM3laRaQOT94qtePxmpKNJinVvF+pKXWyQ/M7t4p4w0jU6HySO356pCJMQybUhN2WWoL pF6eJOlZzH6ntzyiOXL7SItNmUBS2jBb8s/iAV/u+I7yyo68qAGSR0Ukn6dNDWYTMGh6 AncQ== 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=NyOi1KHZzjHk0cRg4NJ7RHeXSuM6jdUUobj5WiahJ6Q=; b=AS8jmNGsWaG8f+cXv+I9GGvmEl2dKOFGM2yQkPdh1z3hEvEwokMQvzIoCtkLfq2dAX /+qwqDsPLSkONne0WmSTNu3CWx0/g0nIzki7anFqYvwYBL8pK5HGs468kzDFXqxRAn/N BrLJnQT98SI1OM2YX4LeGqdxw4m8tVRF+W/tuiYiwR/GsIqas92HhqT/fvUGIB/nw5xr CKbf6p7+rOZPmxQsi1HNpBMZUD5UsNp4ekoWuWu4h3fWtu0YJ+ATh3IwJ1ylH1pZmD9o a8x5A+2cWKTeytH9ELyAWZl5XyazES3+BeaXI0Pl5VCIlCl6PGCMklIdZD4fT4VvOdwU +0XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hhevQbJd; 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 ox7si21508871ejb.512.2021.07.19.08.08.43; Mon, 19 Jul 2021 08:08:43 -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=hhevQbJd; 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 S242249AbhGSO17 (ORCPT + 12 others); Mon, 19 Jul 2021 10:27:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:38474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243186AbhGSO0W (ORCPT ); Mon, 19 Jul 2021 10:26:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 27281610A5; Mon, 19 Jul 2021 15:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626707222; bh=UPvY9TDJNFJ+IvpRKDOqyPzpCmbXCH0z2RGVsbMFq/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hhevQbJdWX6vBdzT9UmIWP2KsMp7nwHXxNCM+bXJZqVa883hg8Vhu/uCC7OOhBdxs riqEQh8DbMEoe8kinchldlicqU7AK1cUjRxpKlMS5J5ZbEIQn0WLY0DhSU3cMlfJ4/ pP6R0K4VbAsnz1/pDTxSJTpl9NfPZGaqDcVgTKWE= 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.9 076/245] ehea: fix error return code in ehea_restart_qps() Date: Mon, 19 Jul 2021 16:50:18 +0200 Message-Id: <20210719144942.868991365@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.288257948@linuxfoundation.org> References: <20210719144940.288257948@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 3692adb8902d..6c70cba92df0 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c @@ -2656,10 +2656,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]; @@ -2679,6 +2677,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; } @@ -2691,6 +2690,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; } @@ -2699,6 +2699,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; }