RDMA/qedr: Fix null-pointer dereference when calling rdma_user_mmap_get_offset
authorMichal Kalderon <michal.kalderon@marvell.com>
Mon, 18 Nov 2019 15:06:45 +0000 (17:06 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 19 Nov 2019 20:15:36 +0000 (16:15 -0400)
commita25984f3baaa97079ce3e75c5a1d362155915a31
tree62b12445e94ad571541f07f8125c46dc9dbc5ffb
parent0acc637dacb6bf12a17c9ad0c41d9ff3696d8b05
RDMA/qedr: Fix null-pointer dereference when calling rdma_user_mmap_get_offset

When running against rdma-core that doesn't support doorbell recovery, the
rdma_user_mmap_entry won't be allocated for doorbell recovery related
mappings.

We have a flag indicating whether rdma-core supports doorbell recovery or
not which was used during initialization, however some cases didn't check
that the rdma_user_mmap_entry exists before attempting to acquire it's
offset.

Fixes: 97f612509294 ("RDMA/qedr: Add doorbell overflow recovery support")
Link: https://lore.kernel.org/r/20191118150645.26602-1-michal.kalderon@marvell.com
Signed-off-by: Ariel Elior <ariel.elior@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/qedr/verbs.c