Skip to contentSkip to conversation

tun: Fixed unsigned/signed comparison

PATCH Applied Alex Gartrell 2 participants 2 messages Dec 26, 2014 – Dec 31, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tun: Fixed unsigned/signed comparison

Validated that this was actually using the unsigned comparison with gdb.

---
 drivers/net/tun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/tun.c +1 -1
index a5cbf67..6c63e21 100644
@@ -1499,7 +1499,7 @@ static int tun_recvmsg(struct kiocb *iocb, struct socket *sock,
 		goto out;
 	}
 	ret = tun_do_read(tun, tfile, &m->msg_iter, flags & MSG_DONTWAIT);
-	if (ret > total_len) {
+	if (ret > (ssize_t)total_len) {
 		m->msg_flags |= MSG_TRUNC;
 		ret = flags & MSG_TRUNC ? ret : total_len;
 	}
Signature · 1 line
Alex Gartrell <[email protected]>