Skip to contentSkip to conversation

IB/mlx5: Fix error handling in UVERBS_HANDLER

PATCH Leon Romanovsky 1 participant 1 message Dec 22, 2018 1 message not in the archive InfiniBand

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20181222081335.GA13088@embeddedor

#1 lore raw
Quoted 9 lines · Gustavo A. R. Silva

Currently, if uverbs_attr_ptr_get_array_size() fails, the returned error turns into a huge value, once it is being store into a variable of type size_t (unsigned long), hence never actually reporting such error and causing unexpected behavior when executing function mlx5_ib_create_modify_header().

Fix this by changing the type of variable num_actions from size_t to int.

Quoted 6 lines

Addresses-Coverity-ID: 1475957 ("Unsigned compared against 0")

Fixes cbfdd442c43e ("IB/uverbs: Add helper to get array size from ptr attribute")
---
 drivers/infiniband/hw/mlx5/flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for fixing it, but I see that Dam already sent fix for that.