diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-29 04:15:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-04 00:42:51 -0500 |
commit | 5d66fe92a19fb41373d13e75831169a6b5e5bef5 (patch) | |
tree | 4a988fc18972b460f9410ec9e0600ef799d42963 /drivers/net | |
parent | 52ee264bca378835decb827d18b1d90b709ca4c9 (diff) |
drivers/net : Correct the size argument to kzalloc
lp->rx_skb has type struct sk_buff **, not struct sk_buff *, so the
elements of the array should have pointer type, not structure type.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@disable sizeof_type_expr@
type T;
T **x;
@@
x =
<+...sizeof(
- T
+ *x
)...+>
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ll_temac_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c index 336e7c7a9275..a8522bd73ae7 100644 --- a/drivers/net/ll_temac_main.c +++ b/drivers/net/ll_temac_main.c | |||
@@ -134,7 +134,7 @@ static int temac_dma_bd_init(struct net_device *ndev) | |||
134 | struct sk_buff *skb; | 134 | struct sk_buff *skb; |
135 | int i; | 135 | int i; |
136 | 136 | ||
137 | lp->rx_skb = kzalloc(sizeof(struct sk_buff)*RX_BD_NUM, GFP_KERNEL); | 137 | lp->rx_skb = kzalloc(sizeof(*lp->rx_skb) * RX_BD_NUM, GFP_KERNEL); |
138 | /* allocate the tx and rx ring buffer descriptors. */ | 138 | /* allocate the tx and rx ring buffer descriptors. */ |
139 | /* returns a virtual addres and a physical address. */ | 139 | /* returns a virtual addres and a physical address. */ |
140 | lp->tx_bd_v = dma_alloc_coherent(ndev->dev.parent, | 140 | lp->tx_bd_v = dma_alloc_coherent(ndev->dev.parent, |