X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fusb%2Fhost%2Fehci-mem.c;fp=drivers%2Fusb%2Fhost%2Fehci-mem.c;h=91c2ab43cbcc1a58412751505400e1db045f1909;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=766061e0260a5e96d6258149bc6f7f8a31f71ee9;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 766061e02..91c2ab43c 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c @@ -75,6 +75,7 @@ static void qh_destroy (struct kref *kref) } if (qh->dummy) ehci_qtd_free (ehci, qh->dummy); + usb_put_dev (qh->dev); dma_pool_free (ehci->qh_pool, qh, qh->qh_dma); } @@ -220,9 +221,13 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags) ehci->periodic [i] = EHCI_LIST_END; /* software shadow of hardware table */ - ehci->pshadow = kcalloc(ehci->periodic_size, sizeof(void *), flags); - if (ehci->pshadow != NULL) - return 0; + ehci->pshadow = kmalloc (ehci->periodic_size * sizeof (void *), flags); + if (ehci->pshadow == NULL) { + goto fail; + } + memset (ehci->pshadow, 0, ehci->periodic_size * sizeof (void *)); + + return 0; fail: ehci_dbg (ehci, "couldn't init memory\n");