android_kernel_oneplus_msm8998/drivers/infiniband/hw
Leon Romanovsky b765889331 IB/mlx4: Fix mlx4_ib_alloc_mr error flow
[ Upstream commit 5a371cf87e145b86efd32007e46146e78c1eff6d ]

ibmr.device is being set only after ib_alloc_mr() is successfully complete.
Therefore, in case imlx4_mr_enable() returns with error, the error flow
unwinder calls to mlx4_free_priv_pages(), which uses ibmr.device.

Such usage causes to NULL dereference oops and to fix it, the IB device
should be set in the mr struct earlier stage (e.g. prior to calling
mlx4_free_priv_pages()).

Fixes: 1b2cd0fc67 ("IB/mlx4: Support the new memory registration API")
Signed-off-by: Nitzan Carmi <nitzanc@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-03 10:19:43 +01:00
..
cxgb3 iw_cxgb3: Fix incorrectly returning error on success 2016-03-03 15:07:10 -08:00
cxgb4 infiniband: cxgb4: use %pR format string for printing resources 2018-02-25 11:03:48 +01:00
mlx4 IB/mlx4: Fix mlx4_ib_alloc_mr error flow 2018-03-03 10:19:43 +01:00
mlx5 IB/mlx5: Assign send CQ and recv CQ of UMR QP 2017-12-16 10:33:55 +01:00
mthca Merge branch 'wr-cleanup' into k.o/for-4.4 2015-10-28 22:23:34 -04:00
nes Initial 4.4 merge window submission 2015-11-07 13:33:07 -08:00
ocrdma RDMA/ocrdma: Depend on async link events from CNA 2015-12-28 11:45:54 -05:00
qib IB/qib: fix false-postive maybe-uninitialized warning 2017-10-08 10:14:20 +02:00
usnic usnic: correctly handle kzalloc return value 2015-10-21 16:41:19 -04:00
Makefile IB/ehca: Deprecate driver, move to staging, schedule deletion 2015-09-11 18:13:35 -04:00