Return-Path: Received: from mail-sn1nam02on0094.outbound.protection.outlook.com ([104.47.36.94]:47840 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728023AbeH3WRv (ORCPT ); Thu, 30 Aug 2018 18:17:51 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: YueHaibing , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.9 35/42] RDS: IB: fix 'passing zero to ERR_PTR()' warning Date: Thu, 30 Aug 2018 18:14:24 +0000 Message-ID: <20180830181245.36526-35-alexander.levin@microsoft.com> References: <20180830181245.36526-1-alexander.levin@microsoft.com> In-Reply-To: <20180830181245.36526-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: YueHaibing [ Upstream commit 5941923da29e84bc9e2a1abb2c14fffaf8d71e2f ] Fix a static code checker warning: net/rds/ib_frmr.c:82 rds_ib_alloc_frmr() warn: passing zero to 'ERR_PTR' The error path for ib_alloc_mr failure should set err to PTR_ERR. Fixes: 1659185fb4d0 ("RDS: IB: Support Fastreg MR (FRMR) memory registratio= n mode") Signed-off-by: YueHaibing Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/rds/ib_frmr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rds/ib_frmr.c b/net/rds/ib_frmr.c index 66b3d6228a15..3d9c4c6397c3 100644 --- a/net/rds/ib_frmr.c +++ b/net/rds/ib_frmr.c @@ -61,6 +61,7 @@ static struct rds_ib_mr *rds_ib_alloc_frmr(struct rds_ib_= device *rds_ibdev, pool->fmr_attr.max_pages); if (IS_ERR(frmr->mr)) { pr_warn("RDS/IB: %s failed to allocate MR", __func__); + err =3D PTR_ERR(frmr->mr); goto out_no_cigar; } =20 --=20 2.17.1