rdma: fix coverity 249197

flags is u64, makes sure we do not overflow when shifting.

Type: fix

Change-Id: Ieea34187c0b568dc4d24c9415b9cff36907a5a87
Signed-off-by: Benoît Ganne <bganne@cisco.com>
This commit is contained in:
Benoît Ganne
2022-08-23 17:05:58 +02:00
committed by Andrew Yourtchenko
parent 174f5c8502
commit a6b2d7ed5a

View File

@ -58,13 +58,13 @@ format_rdma_bit_flag (u8 * s, va_list * args)
while (flags)
{
if ((flags & (1 << i)))
if ((flags & ((u64) 1 << i)))
{
if (i < n_strs && strs[i] != 0)
s = format (s, " %s", strs[i]);
else
s = format (s, " unknown(%u)", i);
flags ^= 1 << i;
flags ^= (u64) 1 << i;
}
i++;
}