Skip to content

Commit

Permalink
usb: musb: Fix bad call to kfree() in musb_free
Browse files Browse the repository at this point in the history
Commit 6228596 (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>
  • Loading branch information
Brian Downing authored and Felipe Balbi committed Aug 7, 2012
1 parent a156544 commit decadac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,7 @@ static void musb_free(struct musb *musb)
dma_controller_destroy(c);
}

kfree(musb);
usb_put_hcd(musb_to_hcd(musb));
}

/*
Expand Down

0 comments on commit decadac

Please sign in to comment.