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

tulip: Fix null dereference in uli526x_rx_packet()

Acked-by: Grant Grundler <grundler@parisc-linux.org>

Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Kyle McMartin and committed by
David S. Miller
ac90a149 a6d36d56

+5 -3
+5 -3
drivers/net/tulip/uli526x.c
··· 851 851 852 852 if ( !(rdes0 & 0x8000) || 853 853 ((db->cr6_data & CR6_PM) && (rxlen>6)) ) { 854 + struct sk_buff *new_skb = NULL; 855 + 854 856 skb = rxptr->rx_skb_ptr; 855 857 856 858 /* Good packet, send to upper layer */ 857 859 /* Shorst packet used new SKB */ 858 - if ( (rxlen < RX_COPY_SIZE) && 859 - ( (skb = dev_alloc_skb(rxlen + 2) ) 860 - != NULL) ) { 860 + if ((rxlen < RX_COPY_SIZE) && 861 + ((new_skb = dev_alloc_skb(rxlen + 2) != NULL))) { 862 + skb = new_skb; 861 863 /* size less than COPY_SIZE, allocate a rxlen SKB */ 862 864 skb_reserve(skb, 2); /* 16byte align */ 863 865 memcpy(skb_put(skb, rxlen),