Skip to content

Commit

Permalink
RDS: IB: fix 'passing zero to ERR_PTR()' warning
Browse files Browse the repository at this point in the history
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: 1659185 ("RDS: IB: Support Fastreg MR (FRMR) memory registration mode")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YueHaibing authored and davem330 committed Aug 7, 2018
1 parent 6f70573 commit 5941923
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/rds/ib_frmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5941923

Please sign in to comment.