mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 14:42:24 +00:00
net/smc: fix another sizeof to int comparison
Comparing an int to a size, which is unsigned, causes the int to become unsigned, giving the wrong result. kernel_sendmsg can return a negative error code. Signed-off-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7596175e99
commit
14d22d4d61
@ -378,7 +378,7 @@ int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info)
|
||||
vec.iov_len = sizeof(struct smc_clc_msg_decline);
|
||||
len = kernel_sendmsg(smc->clcsock, &msg, &vec, 1,
|
||||
sizeof(struct smc_clc_msg_decline));
|
||||
if (len < sizeof(struct smc_clc_msg_decline))
|
||||
if (len < 0 || len < sizeof(struct smc_clc_msg_decline))
|
||||
len = -EPROTO;
|
||||
return len > 0 ? 0 : len;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user