diff options
author | David S. Miller <davem@davemloft.net> | 2015-11-02 15:56:12 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-02 15:56:12 -0500 |
commit | d3e8b858f375595421817a5475611a3e63bb4a43 (patch) | |
tree | 7df2e239dd3aae3ab9e4d65dcdd00326cd97e0b5 | |
parent | 615a1003c6502f0d1812fd2dbe08e86b1c3f5db9 (diff) | |
parent | b61ed8fdd845340ee31e8a97403b6101ccf4e4a2 (diff) | |
download | talos-obmc-linux-d3e8b858f375595421817a5475611a3e63bb4a43.tar.gz talos-obmc-linux-d3e8b858f375595421817a5475611a3e63bb4a43.zip |
Merge branch 'sh_eth-fixes'
Sergei Shtylyov says:
====================
sh_eth: fix bugs in sh_eth_ring_init()
Here's a set of 2 patches against DaveM's 'net.git' repo which fix couple of
bugs in the sh_eth_ring_init() function.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index a484d8beb855..459c93aff03e 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -1212,15 +1212,15 @@ static int sh_eth_ring_init(struct net_device *ndev) mdp->rx_buf_sz += NET_IP_ALIGN; /* Allocate RX and TX skb rings */ - mdp->rx_skbuff = kmalloc_array(mdp->num_rx_ring, - sizeof(*mdp->rx_skbuff), GFP_KERNEL); + mdp->rx_skbuff = kcalloc(mdp->num_rx_ring, sizeof(*mdp->rx_skbuff), + GFP_KERNEL); if (!mdp->rx_skbuff) { ret = -ENOMEM; return ret; } - mdp->tx_skbuff = kmalloc_array(mdp->num_tx_ring, - sizeof(*mdp->tx_skbuff), GFP_KERNEL); + mdp->tx_skbuff = kcalloc(mdp->num_tx_ring, sizeof(*mdp->tx_skbuff), + GFP_KERNEL); if (!mdp->tx_skbuff) { ret = -ENOMEM; goto skb_ring_free; @@ -1232,7 +1232,7 @@ static int sh_eth_ring_init(struct net_device *ndev) GFP_KERNEL); if (!mdp->rx_ring) { ret = -ENOMEM; - goto desc_ring_free; + goto skb_ring_free; } mdp->dirty_rx = 0; |