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>
This commit is contained in:

committed by
David S. Miller

parent
e9ba103931
commit
14f8dc4953
@@ -2920,14 +2920,11 @@ static int ql_alloc_rx_resources(struct ql_adapter *qdev,
|
||||
/*
|
||||
* Allocate small buffer queue control blocks.
|
||||
*/
|
||||
rx_ring->sbq =
|
||||
kmalloc(rx_ring->sbq_len * sizeof(struct bq_desc),
|
||||
GFP_KERNEL);
|
||||
if (rx_ring->sbq == NULL) {
|
||||
netif_err(qdev, ifup, qdev->ndev,
|
||||
"Small buffer queue control block allocation failed.\n");
|
||||
rx_ring->sbq = kmalloc_array(rx_ring->sbq_len,
|
||||
sizeof(struct bq_desc),
|
||||
GFP_KERNEL);
|
||||
if (rx_ring->sbq == NULL)
|
||||
goto err_mem;
|
||||
}
|
||||
|
||||
ql_init_sbq_ring(qdev, rx_ring);
|
||||
}
|
||||
@@ -2948,14 +2945,11 @@ static int ql_alloc_rx_resources(struct ql_adapter *qdev,
|
||||
/*
|
||||
* Allocate large buffer queue control blocks.
|
||||
*/
|
||||
rx_ring->lbq =
|
||||
kmalloc(rx_ring->lbq_len * sizeof(struct bq_desc),
|
||||
GFP_KERNEL);
|
||||
if (rx_ring->lbq == NULL) {
|
||||
netif_err(qdev, ifup, qdev->ndev,
|
||||
"Large buffer queue control block allocation failed.\n");
|
||||
rx_ring->lbq = kmalloc_array(rx_ring->lbq_len,
|
||||
sizeof(struct bq_desc),
|
||||
GFP_KERNEL);
|
||||
if (rx_ring->lbq == NULL)
|
||||
goto err_mem;
|
||||
}
|
||||
|
||||
ql_init_lbq_ring(qdev, rx_ring);
|
||||
}
|
||||
|
Reference in New Issue
Block a user