Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[netdrvr eepro100] check for skb==NULL before calling rx_align(skb)

+4 -4
+4 -4
drivers/net/eepro100.c
··· 1263 1263 for (i = 0; i < RX_RING_SIZE; i++) { 1264 1264 struct sk_buff *skb; 1265 1265 skb = dev_alloc_skb(PKT_BUF_SZ + sizeof(struct RxFD)); 1266 - /* XXX: do we really want to call this before the NULL check? --hch */ 1267 - rx_align(skb); /* Align IP on 16 byte boundary */ 1266 + if (skb) 1267 + rx_align(skb); /* Align IP on 16 byte boundary */ 1268 1268 sp->rx_skbuff[i] = skb; 1269 1269 if (skb == NULL) 1270 1270 break; /* OK. Just initially short of Rx bufs. */ ··· 1654 1654 struct sk_buff *skb; 1655 1655 /* Get a fresh skbuff to replace the consumed one. */ 1656 1656 skb = dev_alloc_skb(PKT_BUF_SZ + sizeof(struct RxFD)); 1657 - /* XXX: do we really want to call this before the NULL check? --hch */ 1658 - rx_align(skb); /* Align IP on 16 byte boundary */ 1657 + if (skb) 1658 + rx_align(skb); /* Align IP on 16 byte boundary */ 1659 1659 sp->rx_skbuff[entry] = skb; 1660 1660 if (skb == NULL) { 1661 1661 sp->rx_ringp[entry] = NULL;