Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1462581ybl; Thu, 22 Aug 2019 15:12:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAklYtnGubHYTQ1HYRyN5ldCybtPlNk00BuUyqP4uhhL3MaYsln7I25tMRQOc34U6u49nA X-Received: by 2002:a62:34c4:: with SMTP id b187mr1554129pfa.161.1566511925104; Thu, 22 Aug 2019 15:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566511925; cv=none; d=google.com; s=arc-20160816; b=RHqu4+g1PASwSxvkrTLtHU2KRGg3ikYNLuStbK0ZNqvCLYx62G/PSAVNCLF+KROnxC //XNyZst3xEJTcQD3gNbSDUE9zwIKtBvJg9QWp5Qv97Gns3XVggBVPwqzCWfp1cbqwFj s+7uZmShYOAsogRrmKonkWvIc04CCqsZ+fV97awdplxF/N5HVGbhWSJTorYgNi1r8T7U Y6WiY1cpsE/uYBQR7Kcc/hbbUtX5fOeuJhG8bOclBnfUsprIUlOKcGZKFYFhhIxIQ23H CXEzMp63U0ROnpYWzLzzPyHUNHRyrY7wwv3bU1CcEIqA07vVLydxBpvL6/J9rt2Wlj3e Tz6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=52wFcxblM9yu91oAkfx/RJrT3Mj/0lZ3atm3ataW+HA=; b=0qv6QXq0M9G8FCXD4Qp/eH8kWzPvD5qSu9zAqMEQJKmIRSs9O0Jnw98jFbxd7HcjCp jVItaefq5vwnHOY3enaMvZueXQPn6CFQi23E6ymTAjsPyNzhD5LQLF2TnnH5OlawzwpB FWkQ4EKgRGLwFDKGOLtN/QU2Y+ew5BORkjiKkgMvP9FdqnzI+jFoKF+kqqDxXRMY+s2/ HehtWcHnYPKY1o0rw0Iptg9tm03GJoGgyfGRN/da0qHvlCXat/F2DN+IYsjVSUuC7SrA HI0lT3bEmcYtyPQGf2qfsK2mkF6aTEg5TC190X7GEBMJ8LgNcEfRVriuTAnTQtFJM8K8 RRdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sub19L+3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fr6si699371pjb.59.2019.08.22.15.11.50; Thu, 22 Aug 2019 15:12:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sub19L+3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390653AbfHVRJF (ORCPT + 99 others); Thu, 22 Aug 2019 13:09:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:59084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388965AbfHVRI7 (ORCPT ); Thu, 22 Aug 2019 13:08:59 -0400 Received: from sasha-vm.mshome.net (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6EC382341E; Thu, 22 Aug 2019 17:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566493738; bh=gHKN6VO5FHUT4n/WevuPBAN7VBwc4Wg2WGpEHcz+kKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sub19L+3xTto1xgiFeElnjz0hGjgd8GO27LjLl9QGeQmtNE3+oXowbwRmXla3vhbv WQtKnqgkezLc35Wh7xkWIyAchPSTIrl8IcUfVgLJUYUckgeWkfxbDdwVyqk02R0CwD +5ziD/Mc8N72yv793TPO2fw5g2WoRpcfDYf2osBI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wei Yongjun , Leon Romanovsky , Doug Ledford , Sasha Levin Subject: [PATCH 5.2 082/135] RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp() Date: Thu, 22 Aug 2019 13:07:18 -0400 Message-Id: <20190822170811.13303-83-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822170811.13303-1-sashal@kernel.org> References: <20190822170811.13303-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.2.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.2.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.2.10-rc1 X-KernelTest-Deadline: 2019-08-24T17:07+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun [ Upstream commit 020fb3bebc224dfe9353a56ecbe2d5fac499dffc ] Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error handling case instead of 0, as done elsewhere in this function. Fixes: e8ac9389f0d7 ("RDMA: Fix allocation failure on pointer pd") Fixes: 21a428a019c9 ("RDMA: Handle PD allocations by IB/core") Signed-off-by: Wei Yongjun Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20190801012725.150493-1-weiyongjun1@huawei.com Signed-off-by: Doug Ledford Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c index e068a02122f5e..9496c69fff3a2 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c @@ -745,8 +745,10 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev) ibdev = &hr_dev->ib_dev; pd = rdma_zalloc_drv_obj(ibdev, ib_pd); - if (!pd) + if (!pd) { + ret = -ENOMEM; goto alloc_mem_failed; + } pd->device = ibdev; ret = hns_roce_alloc_pd(pd, NULL); -- 2.20.1