mirror of https://gitee.com/openkylin/linux.git
usbnet: remove invalid check
skb->len is always non-negative. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7e724da644
commit
227b9e8708
|
@ -2424,11 +2424,6 @@ static int lan78xx_rx(struct lan78xx_net *dev, struct sk_buff *skb)
|
|||
skb_pull(skb, align_count);
|
||||
}
|
||||
|
||||
if (unlikely(skb->len < 0)) {
|
||||
netdev_warn(dev->net, "invalid rx length<0 %d", skb->len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -2185,11 +2185,6 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
|
|||
skb_pull(skb, align_count);
|
||||
}
|
||||
|
||||
if (unlikely(skb->len < 0)) {
|
||||
netdev_warn(dev->net, "invalid rx length<0 %d\n", skb->len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -1815,11 +1815,6 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
|
|||
skb_pull(skb, align_count);
|
||||
}
|
||||
|
||||
if (unlikely(skb->len < 0)) {
|
||||
netdev_warn(dev->net, "invalid rx length<0 %d\n", skb->len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue