diff options
author | Yishai Hadas <yishaih@nvidia.com> | 2021-03-04 15:05:00 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-03-11 20:20:36 -0400 |
commit | 2904bb37b35d07be7bfa3fb4a0fc1a3daa6678b3 (patch) | |
tree | 13b31401b907cc38deebf0327e1ab35d76b40c66 /lib/test_siphash.c | |
parent | 3f32dc0f4601b180bbfd7b5adc7f82557f1408d0 (diff) |
IB/core: Split uverbs_get_const/default to consider target type
Change uverbs_get_const/uverbs_get_const_default to work properly with
both signed/unsigned parameters.
Current APIs mix s64 and u64 which leads to incorrect check when u64
value was supplied and its upper bit was set. In that case
uverbs_get_const() / uverbs_get_const_default() lower bound check may
fail unexpectedly, target is unsigned (lower bound is 0) but value
became negative as of the s64 usage.
Split to have two different APIs, no change to callers as the required
API will be called internally according to the target type.
Link: https://lore.kernel.org/r/20210304130501.1102577-3-leon@kernel.org
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'lib/test_siphash.c')
0 files changed, 0 insertions, 0 deletions