* [PATCH net-next] RDS: IB: fix 'passing zero to ERR_PTR()' warning
@ 2018-08-07 11:34 YueHaibing
2018-08-07 17:09 ` Santosh Shilimkar
2018-08-07 20:20 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2018-08-07 11:34 UTC (permalink / raw)
To: santosh.shilimkar, davem
Cc: linux-kernel, netdev, linux-rdma, rds-devel, YueHaibing
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 registration mode")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
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 b371cf0..6431a02 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 = PTR_ERR(frmr->mr);
goto out_no_cigar;
}
--
2.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] RDS: IB: fix 'passing zero to ERR_PTR()' warning
2018-08-07 11:34 [PATCH net-next] RDS: IB: fix 'passing zero to ERR_PTR()' warning YueHaibing
@ 2018-08-07 17:09 ` Santosh Shilimkar
2018-08-07 20:20 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Santosh Shilimkar @ 2018-08-07 17:09 UTC (permalink / raw)
To: YueHaibing, davem; +Cc: linux-kernel, netdev, linux-rdma, rds-devel
On 8/7/2018 4:34 AM, YueHaibing wrote:
> 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 registration mode")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
Looks good. Thanks !!
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] RDS: IB: fix 'passing zero to ERR_PTR()' warning
2018-08-07 11:34 [PATCH net-next] RDS: IB: fix 'passing zero to ERR_PTR()' warning YueHaibing
2018-08-07 17:09 ` Santosh Shilimkar
@ 2018-08-07 20:20 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-08-07 20:20 UTC (permalink / raw)
To: yuehaibing; +Cc: santosh.shilimkar, linux-kernel, netdev, linux-rdma, rds-devel
From: YueHaibing <yuehaibing@huawei.com>
Date: Tue, 7 Aug 2018 19:34:16 +0800
> 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 registration mode")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-07 20:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-07 11:34 [PATCH net-next] RDS: IB: fix 'passing zero to ERR_PTR()' warning YueHaibing
2018-08-07 17:09 ` Santosh Shilimkar
2018-08-07 20:20 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).