diff options
author | Hans de Goede <hdegoede@redhat.com> | 2016-06-14 15:13:05 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-14 13:36:23 -0700 |
commit | 969a132723434f3723cc0606373785d19c1d2f05 (patch) | |
tree | c3ba8c523258e8ef758744e0e7e4a6ddb102f7da /drivers/usb/storage/usual-tables.c | |
parent | e4600d56323ed119469fdcb21564f7544e1e6b3c (diff) |
usb: musb: sunxi: Fix NULL ptr deref when gadget is registered before musb
Stop using the return value of platform_device_register_full() to get to
the struct musb in sunxi_musb_work(). If a gadget has been registered
(insmod-ed) before the musb driver, then musb_start will get called
from the musb_core probe function and sunxi_musb_work() may run before
platform_device_register_full() has returned.
Instead store a pointer to struct musb in struct sunxi_glue when
sunxi_musb_enable gets called. Note that sunxi_musb_enable always gets
called before sunxi_musb_work() can run.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[b-liu@ti.com: revise subject prefix]
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/storage/usual-tables.c')
0 files changed, 0 insertions, 0 deletions