diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-30 09:34:37 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:54:00 -0500 |
commit | 4585ef11d23aa9dbbf776b135ba70577df97587b (patch) | |
tree | d12fd11671b7f30b0de88a8533ffc0785eff1183 /drivers/usb/host/fhci-hcd.c | |
parent | 0f2c2d7bbb51338fdcda9670795a6c6e348622d9 (diff) |
USB: FHCI: Correct the size argument to kzalloc
urb_priv->tds has type struct td **, not struct td *, so the
elements of the array should have pointer type, not structure type.
Convert kzalloc to kcalloc as well.
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/fhci-hcd.c')
-rw-r--r-- | drivers/usb/host/fhci-hcd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c index 78e7c3cfcb72..ed4b87c68e4f 100644 --- a/drivers/usb/host/fhci-hcd.c +++ b/drivers/usb/host/fhci-hcd.c | |||
@@ -433,7 +433,7 @@ static int fhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
433 | return -ENOMEM; | 433 | return -ENOMEM; |
434 | 434 | ||
435 | /* allocate the private part of the URB */ | 435 | /* allocate the private part of the URB */ |
436 | urb_priv->tds = kzalloc(size * sizeof(struct td), mem_flags); | 436 | urb_priv->tds = kcalloc(size, sizeof(*urb_priv->tds), mem_flags); |
437 | if (!urb_priv->tds) { | 437 | if (!urb_priv->tds) { |
438 | kfree(urb_priv); | 438 | kfree(urb_priv); |
439 | return -ENOMEM; | 439 | return -ENOMEM; |