]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/uverbs: Don't overwrite NULL pointer with ZERO_SIZE_PTR
authorLeon Romanovsky <leonro@mellanox.com>
Sun, 24 Jun 2018 08:23:47 +0000 (11:23 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 26 Jun 2018 20:37:26 +0000 (14:37 -0600)
commita0208f4401e9400b05ee3fccf04bd9c97cd5f1ae
treeeee06b73f3d4ef70e55d0df13ed6f95010349a9e
parentfc9ee8f749192f030d572d46496b3e6cfae0e1e1
RDMA/uverbs: Don't overwrite NULL pointer with ZERO_SIZE_PTR

Number of specs is provided by user and in valid case can be equal to zero.
Such argument causes to call to kcalloc() with zero-length request and in
return the ZERO_SIZE_PTR is assigned. This pointer is different from NULL
and makes various if (..) checks to success.

Fixes: e58596071643 ("IB/uverbs: Add support for flow counters")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs_cmd.c