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:
Ursula Braun 2019-01-30 18:51:00 +01:00 committed by David S. Miller
parent 7596175e99
commit 14d22d4d61

View File

@ -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); vec.iov_len = sizeof(struct smc_clc_msg_decline);
len = kernel_sendmsg(smc->clcsock, &msg, &vec, 1, len = kernel_sendmsg(smc->clcsock, &msg, &vec, 1,
sizeof(struct smc_clc_msg_decline)); 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; len = -EPROTO;
return len > 0 ? 0 : len; return len > 0 ? 0 : len;
} }