dect
/
linux-2.6
Archived
13
0
Fork 0

usb: musb: Fix bad call to kfree() in musb_free

Commit 622859634a (usb: musb: drop a
gigantic amount of ifdeferry) included this change:

    @@ -1901,11 +1844,7 @@ static void musb_free(struct musb *musb)
                    dma_controller_destroy(c);
            }

    -#ifdef CONFIG_USB_MUSB_HDRC_HCD
    -       usb_put_hcd(musb_to_hcd(musb));
    -#else
            kfree(musb);
    -#endif
     }

     /*

Since musb comes from struct usb_hcd's hcd_priv, which is allocated on
the end of that struct, kfree'ing it is not going to work.  Replace
kfree(musb) with usb_put_hcd(musb_to_hcd(musb)), which appears to be
the right thing to do here.

Signed-off-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Brian Downing 2012-08-04 18:32:19 -05:00 committed by Felipe Balbi
parent a156544bc9
commit decadacbd7
1 changed files with 1 additions and 1 deletions

View File

@ -1868,7 +1868,7 @@ static void musb_free(struct musb *musb)
dma_controller_destroy(c);
}
kfree(musb);
usb_put_hcd(musb_to_hcd(musb));
}
/*