mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
RDMA/rxe: Fix a couple IS_ERR() vs NULL bugs
The lookup_mr() function returns NULL on error. It never returns error pointers. Fixes:9284bc34c7("RDMA/rxe: Enable asynchronous prefetch for ODP MRs") Fixes:3576b0df15("RDMA/rxe: Implement synchronous prefetch for ODP MRs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/685c1430.050a0220.18b0ef.da83@mx.google.com Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev> Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
12423d8e18
commit
19564a8576
|
|
@ -470,10 +470,10 @@ static int rxe_ib_prefetch_sg_list(struct ib_pd *ibpd,
|
|||
mr = lookup_mr(pd, IB_ACCESS_LOCAL_WRITE,
|
||||
sg_list[i].lkey, RXE_LOOKUP_LOCAL);
|
||||
|
||||
if (IS_ERR(mr)) {
|
||||
if (!mr) {
|
||||
rxe_dbg_pd(pd, "mr with lkey %x not found\n",
|
||||
sg_list[i].lkey);
|
||||
return PTR_ERR(mr);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (advice == IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE &&
|
||||
|
|
@ -535,8 +535,10 @@ static int rxe_ib_advise_mr_prefetch(struct ib_pd *ibpd,
|
|||
/* Takes a reference, which will be released in the queued work */
|
||||
mr = lookup_mr(pd, IB_ACCESS_LOCAL_WRITE,
|
||||
sg_list[i].lkey, RXE_LOOKUP_LOCAL);
|
||||
if (IS_ERR(mr))
|
||||
if (!mr) {
|
||||
mr = ERR_PTR(-EINVAL);
|
||||
goto err;
|
||||
}
|
||||
|
||||
work->frags[i].io_virt = sg_list[i].addr;
|
||||
work->frags[i].length = sg_list[i].length;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user