aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorKyle McMartin <kyle@mcmartin.ca>2009-03-27 13:23:32 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-26 23:20:29 -0400
commitac90a149361a331f697d5aa500bedcff22054669 (patch)
tree56ec8e9d5bb0770814682257deae523eede6f9b7 /drivers/net
parenta6d36d5689b1806a3365c909192e9f03a43a632b (diff)
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tulip/uli526x.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index 0ab05af237e5..90be57bad39d 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -851,13 +851,15 @@ static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info
851 851
852 if ( !(rdes0 & 0x8000) || 852 if ( !(rdes0 & 0x8000) ||
853 ((db->cr6_data & CR6_PM) && (rxlen>6)) ) { 853 ((db->cr6_data & CR6_PM) && (rxlen>6)) ) {
854 struct sk_buff *new_skb = NULL;
855
854 skb = rxptr->rx_skb_ptr; 856 skb = rxptr->rx_skb_ptr;
855 857
856 /* Good packet, send to upper layer */ 858 /* Good packet, send to upper layer */
857 /* Shorst packet used new SKB */ 859 /* Shorst packet used new SKB */
858 if ( (rxlen < RX_COPY_SIZE) && 860 if ((rxlen < RX_COPY_SIZE) &&
859 ( (skb = dev_alloc_skb(rxlen + 2) ) 861 ((new_skb = dev_alloc_skb(rxlen + 2) != NULL))) {
860 != NULL) ) { 862 skb = new_skb;
861 /* size less than COPY_SIZE, allocate a rxlen SKB */ 863 /* size less than COPY_SIZE, allocate a rxlen SKB */
862 skb_reserve(skb, 2); /* 16byte align */ 864 skb_reserve(skb, 2); /* 16byte align */
863 memcpy(skb_put(skb, rxlen), 865 memcpy(skb_put(skb, rxlen),