Skip to content

Commit

Permalink
tulip: Fix null dereference in uli526x_rx_packet()
Browse files Browse the repository at this point in the history
Acked-by: Grant Grundler <grundler@parisc-linux.org>

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kyle McMartin authored and David S. Miller committed Mar 27, 2010
1 parent a6d36d5 commit ac90a14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/tulip/uli526x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit ac90a14

Please sign in to comment.