RDMA/siw: Properly check send and receive CQ pointers
authorLeon Romanovsky <leonro@nvidia.com>
Sun, 9 May 2021 11:39:21 +0000 (14:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 May 2021 10:06:47 +0000 (12:06 +0200)
commitb83b491927677a897f741dce092caa391e8deff2
tree9ff4383b5b0a4ee622682bb76c48aa0c7ae83546
parentc39a190d834dee504a09ef8b54786cc43c9e3568
RDMA/siw: Properly check send and receive CQ pointers

[ Upstream commit a568814a55a0e82bbc7c7b51333d0c38e8fb5520 ]

The check for the NULL of pointer received from container_of() is
incorrect by definition as it points to some offset from NULL.

Change such check with proper NULL check of SIW QP attributes.

Fixes: 303ae1cdfdf7 ("rdma/siw: application interface")
Link: https://lore.kernel.org/r/a7535a82925f6f4c1f062abaa294f3ae6e54bdd2.1620560310.git.leonro@nvidia.com
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/sw/siw/siw_verbs.c