RDMA/uverbs: Fix incorrect variable type
authorAvihai Horon <avihaih@nvidia.com>
Tue, 8 Dec 2020 07:35:45 +0000 (09:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:47 +0000 (11:53 +0100)
commit1cbcdec82c53a4a03d5d6db831a1c0228dfe1109
treee28d088c957bc1e7fa2b2868a242c27ef67332e5
parent53e9a5a692f839780084ad81dbd461ec917f74f7
RDMA/uverbs: Fix incorrect variable type

[ Upstream commit e0da68994d16b46384cce7b86eb645f1ef7c51ef ]

Fix incorrect type of max_entries in UVERBS_METHOD_QUERY_GID_TABLE -
max_entries is of type size_t although it can take negative values.

The following static check revealed it:

drivers/infiniband/core/uverbs_std_types_device.c:338 ib_uverbs_handler_UVERBS_METHOD_QUERY_GID_TABLE() warn: 'max_entries' unsigned <= 0

Fixes: 9f85cbe50aa0 ("RDMA/uverbs: Expose the new GID query API to user space")
Link: https://lore.kernel.org/r/20201208073545.9723-4-leon@kernel.org
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/uverbs_std_types_device.c
include/rdma/uverbs_ioctl.h