Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340721
b: refs/heads/master
c: 1eb8f7a
h: refs/heads/master
i:
  340719: 1875b35
v: v3
  • Loading branch information
Claudiu Manoil authored and David S. Miller committed Nov 9, 2012
1 parent 9b044e6 commit 957c741
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be44389964c1855ccffedbfbf5d2a943bb84ad66
refs/heads/master: 1eb8f7a7da6d3b36fcc339d7bbddbf8315a5c1dd
14 changes: 8 additions & 6 deletions trunk/drivers/net/ethernet/freescale/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static int gfar_init_bds(struct net_device *ndev)
skb = gfar_new_skb(ndev);
if (!skb) {
netdev_err(ndev, "Can't allocate RX buffers\n");
goto err_rxalloc_fail;
return -ENOMEM;
}
rx_queue->rx_skbuff[j] = skb;

Expand All @@ -223,10 +223,6 @@ static int gfar_init_bds(struct net_device *ndev)
}

return 0;

err_rxalloc_fail:
free_skb_resources(priv);
return -ENOMEM;
}

static int gfar_alloc_skb_resources(struct net_device *ndev)
Expand Down Expand Up @@ -1356,7 +1352,11 @@ static int gfar_restore(struct device *dev)
if (!netif_running(ndev))
return 0;

gfar_init_bds(ndev);
if (gfar_init_bds(ndev)) {
free_skb_resources(priv);
return -ENOMEM;
}

init_registers(ndev);
gfar_set_mac_address(ndev);
gfar_init_mac(ndev);
Expand Down Expand Up @@ -1709,6 +1709,7 @@ static void free_skb_tx_queue(struct gfar_priv_tx_q *tx_queue)
tx_queue->tx_skbuff[i] = NULL;
}
kfree(tx_queue->tx_skbuff);
tx_queue->tx_skbuff = NULL;
}

static void free_skb_rx_queue(struct gfar_priv_rx_q *rx_queue)
Expand All @@ -1732,6 +1733,7 @@ static void free_skb_rx_queue(struct gfar_priv_rx_q *rx_queue)
rxbdp++;
}
kfree(rx_queue->rx_skbuff);
rx_queue->rx_skbuff = NULL;
}

/* If there are any tx skbs or rx skbs still around, free them.
Expand Down

0 comments on commit 957c741

Please sign in to comment.