]> git.baikalelectronics.ru Git - kernel.git/commit
IB/uverbs: Improve lockdep_check
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 13 Feb 2018 10:18:38 +0000 (12:18 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 15 Feb 2018 21:59:47 +0000 (14:59 -0700)
commit771ef2500feb2c2d624b9ce12b979327e6eabd70
treed0e0b27d0a5e658e5e2bcb191b08b395ed8f8ccb
parent4e5e38364b7cd625046e72e6d6fa9be122c1987e
IB/uverbs: Improve lockdep_check

This is really being used as an assert that the expected usecnt
is being held and implicitly that the usecnt is valid. Rename it to
assert_uverbs_usecnt and tighten the checks to only accept valid
values of usecnt (eg 0 and < -1 are invalid).

The tigher checkes make the assertion cover more cases and is more
likely to find bugs via syzkaller/etc.

Fixes: 64b9060fbcb0 ("IB/core: Add support for idr types")
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/rdma_core.c