diff options
author | Joe Perches <joe@perches.com> | 2013-02-07 12:46:27 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-08 23:44:39 +0100 |
commit | 14f8dc49532f765968ff37c3b99edbeb99004ace (patch) | |
tree | a0c2f42ca545b3587a071ad05427c7351c8244e0 /drivers/net/ethernet/smsc/smsc9420.c | |
parent | bgmac: fix "cmdcfg" calls for promisc and loopback modes (diff) | |
download | linux-14f8dc49532f765968ff37c3b99edbeb99004ace.tar.xz linux-14f8dc49532f765968ff37c3b99edbeb99004ace.zip |
drivers: net: Remove remaining alloc/OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.
For the affected mallocs around these OOM messages:
Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/memcpy to kmemdup.
Removed now unused stack variables.
Removed unnecessary parentheses.
Neatened alignment.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/smsc/smsc9420.c')
-rw-r--r-- | drivers/net/ethernet/smsc/smsc9420.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c index ecfb43614d7b..d457fa2d7509 100644 --- a/drivers/net/ethernet/smsc/smsc9420.c +++ b/drivers/net/ethernet/smsc/smsc9420.c @@ -1250,12 +1250,11 @@ static int smsc9420_alloc_tx_ring(struct smsc9420_pdata *pd) BUG_ON(!pd->tx_ring); - pd->tx_buffers = kmalloc((sizeof(struct smsc9420_ring_info) * - TX_RING_SIZE), GFP_KERNEL); - if (!pd->tx_buffers) { - smsc_warn(IFUP, "Failed to allocated tx_buffers"); + pd->tx_buffers = kmalloc_array(TX_RING_SIZE, + sizeof(struct smsc9420_ring_info), + GFP_KERNEL); + if (!pd->tx_buffers) return -ENOMEM; - } /* Initialize the TX Ring */ for (i = 0; i < TX_RING_SIZE; i++) { |