mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 15:12:59 +02:00
RDMA/nes: Fix for crash when registering zero length MR for CQ
commit 7d9c199a55 upstream.
Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c7cde2b3d2
commit
e5ca2896f8
|
|
@ -2559,6 +2559,11 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
|
|||
return ibmr;
|
||||
case IWNES_MEMREG_TYPE_QP:
|
||||
case IWNES_MEMREG_TYPE_CQ:
|
||||
if (!region->length) {
|
||||
nes_debug(NES_DBG_MR, "Unable to register zero length region for CQ\n");
|
||||
ib_umem_release(region);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL);
|
||||
if (!nespbl) {
|
||||
nes_debug(NES_DBG_MR, "Unable to allocate PBL\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user