projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
451bff2
)
mv643xx_eth: Allocate receive queue initialized to zero
author
Lubomir Rintel
<
[email protected]
>
Tue, 18 Jun 2013 17:32:38 +0000
(19:32 +0200)
committer
David S. Miller
<
[email protected]
>
Thu, 20 Jun 2013 05:18:52 +0000
(22:18 -0700)
Zero pointer in rx_skb is how respective rxq_deinit() finds out out that a skb
slot is unallocated. If rxq_refill() fails (e.g. on OOM condition), subsequent
teardown would result in an attempt to kfree() invalid pointers.
Signed-off-by: Lubomir Rintel <
[email protected]
>
Cc: Lennert Buytenhek <
[email protected]
>
Cc:
[email protected]
Cc:
[email protected]
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/marvell/mv643xx_eth.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/marvell/mv643xx_eth.c
b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 2ad1494efbb3021e796481da6c4f48f21e63ca30..d1cbfb12c1ca35cb9f0c0521a4b38bb847cbd199 100644
(file)
--- a/
drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/
drivers/net/ethernet/marvell/mv643xx_eth.c
@@
-1757,7
+1757,7
@@
static int rxq_init(struct mv643xx_eth_private *mp, int index)
memset(rxq->rx_desc_area, 0, size);
rxq->rx_desc_area_size = size;
- rxq->rx_skb = k
malloc_array
(rxq->rx_ring_size, sizeof(*rxq->rx_skb),
+ rxq->rx_skb = k
calloc
(rxq->rx_ring_size, sizeof(*rxq->rx_skb),
GFP_KERNEL);
if (rxq->rx_skb == NULL)
goto out_free;