RDMA/mlx5: Protect from NULL pointer derefence
authorLeon Romanovsky <leonro@mellanox.com>
Tue, 13 Mar 2018 13:29:24 +0000 (15:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:36:31 +0000 (09:36 +0200)
commit28ce82e3c8b116f09ea539e15bbb9f0f09f5fa32
tree7ca13387cdab5448d44630e78d4ab704228f8465
parentb140d94688707e42b75cad3b020563a706101abe
RDMA/mlx5: Protect from NULL pointer derefence

commit 4289861d88d6c7b5e4c8cc7fe2ad6cdf0cdfc366 upstream.

The mlx5_ib_alloc_implicit_mr() can fail to acquire pages
and the returned mr pointer won't be valid. Ensure that it
is not error prior to access.

Cc: <stable@vger.kernel.org> # 4.10
Fixes: 81713d3788d2 ("IB/mlx5: Add implicit MR support")
Reported-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/mlx5/mr.c