summary refs log tree commit diff
path: root/drivers
diff options
context:
space:
mode:
authorKyle McMartin <kyle@mcmartin.ca>2009-03-27 17:23:32 +0000
committerDavid S. Miller <davem@davemloft.net>2010-03-26 20:20:29 -0700
commitac90a149361a331f697d5aa500bedcff22054669 (patch)
tree56ec8e9d5bb0770814682257deae523eede6f9b7 /drivers
parenta6d36d5689b1806a3365c909192e9f03a43a632b (diff)
downloadlinux-ac90a149361a331f697d5aa500bedcff22054669.tar.gz
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')
-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
 
 			if ( !(rdes0 & 0x8000) ||
 				((db->cr6_data & CR6_PM) && (rxlen>6)) ) {
+				struct sk_buff *new_skb = NULL;
+
 				skb = rxptr->rx_skb_ptr;
 
 				/* Good packet, send to upper layer */
 				/* Shorst packet used new SKB */
-				if ( (rxlen < RX_COPY_SIZE) &&
-					( (skb = dev_alloc_skb(rxlen + 2) )
-					!= NULL) ) {
+				if ((rxlen < RX_COPY_SIZE) &&
+				    ((new_skb = dev_alloc_skb(rxlen + 2) != NULL))) {
+					skb = new_skb;
 					/* size less than COPY_SIZE, allocate a rxlen SKB */
 					skb_reserve(skb, 2); /* 16byte align */
 					memcpy(skb_put(skb, rxlen),