RDMA/mlx5: Check for ERR_PTR from uverbs_zalloc()
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 24 Nov 2020 23:34:33 +0000 (19:34 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 26 Nov 2020 19:49:04 +0000 (15:49 -0400)
commitd0b7721c5e0d940a514fbff40b9d7bae92735f7a
treee98eebcea0b6826e52980eda9c6c67caa8c299e1
parent66d86e529dd58616495ea0b03cc687e5d6522b59
RDMA/mlx5: Check for ERR_PTR from uverbs_zalloc()

The return code from uverbs_zalloc() was wrongly checked, it is ERR_PTR
not NULL like other allocators:

drivers/infiniband/hw/mlx5/devx.c:2110 devx_umem_reg_cmd_alloc() warn: passing zero to 'PTR_ERR'

Fixes: 878f7b31c3a7 ("RDMA/mlx5: Use ib_umem_find_best_pgsz() for devx")
Link: https://lore.kernel.org/r/0-v1-4d05ccc1c223+173-devx_err_ptr_jgg@nvidia.com
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/devx.c