提交 decadacb 编写于 作者: B Brian Downing 提交者: Felipe Balbi

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

Commit 62285963 (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: NBrian Downing <bdowning@lavos.net>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 a156544b
......@@ -1868,7 +1868,7 @@ static void musb_free(struct musb *musb)
dma_controller_destroy(c);
}
kfree(musb);
usb_put_hcd(musb_to_hcd(musb));
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册