diff options
author | Dan Carpenter <[email protected]> | 2021-08-16 14:13:33 +0300 |
---|---|---|
committer | David S. Miller <[email protected]> | 2021-08-16 13:40:18 +0100 |
commit | 4f3f2e3fa0431b93745b110da1c365806c5acce3 (patch) | |
tree | f84c05994cc19d332c972a1779841cc4036742ff /lib/test_overflow.c | |
parent | 517c54d282392a2c7dedc80783886d2cd1836c0d (diff) |
net: iosm: Prevent underflow in ipc_chnl_cfg_get()
The bounds check on "index" doesn't catch negative values. Using
ARRAY_SIZE() directly is more readable and more robust because it prevents
negative values for "index". Fortunately we only pass valid values to
ipc_chnl_cfg_get() so this patch does not affect runtime.
Reported-by: Solomon Ucko <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: M Chetan Kumar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions