Skip to content
Commit b5f9efff authored by Chengchang Tang's avatar Chengchang Tang Committed by Leon Romanovsky
Browse files

RDMA/hns: Fix signed-unsigned mixed comparisons

The ib_mtu_enum_to_int() and uverbs_attr_get_len() may returns a negative
value. In this case, mixed comparisons of signed and unsigned types will
throw wrong results.

This patch adds judgement for this situation.

Fixes: 30b70788

 ("RDMA/hns: Support inline data in extented sge space for RC")
Signed-off-by: default avatarChengchang Tang <tangchengchang@huawei.com>
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20231017125239.164455-4-huangjunxian6@hisilicon.com
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent c64e9710
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment