linux-stable-rt/drivers/usb/musb
Sebastian Andrzej Siewior 6193d6997c usb: musb: gadget: fix error path
In case one "forgot" to load the receiver i.e. doing
|modprobe omap2430
|modprobe musb_hdrc

he ends up with:

|musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
|HS USB OTG: no transceiver configured
|musb-hdrc musb-hdrc: musb_init_controller failed with status -19
|(NULL device *): gadget not registered.
|Unable to handle kernel NULL pointer dereference at virtual address 0000001c
|Internal error: Oops: 17 [#1] SMP
|[<c011383c>] (sysfs_find_dirent+0x4/0x60) from [<c01138c0>] (sysfs_get_dirent+0x28/0x78)
|[<c01138c0>] (sysfs_get_dirent+0x28/0x78) from [<c0115b78>] (sysfs_unmerge_group+0x1c/0x90)
|[<c0115b78>] (sysfs_unmerge_group+0x1c/0x90) from [<c0179ba4>] (dpm_sysfs_remove+0x14/0x3c)
|[<c0179ba4>] (dpm_sysfs_remove+0x14/0x3c) from [<c01742f8>] (device_del+0x40/0x1b4)
|[<c01742f8>] (device_del+0x40/0x1b4) from [<c0174478>] (device_unregister+0xc/0x18)
|[<c0174478>] (device_unregister+0xc/0x18) from [<bf0489b4>] (musb_free+0x24/0x88 [musb_hdrc])
|[<bf0489b4>] (musb_free+0x24/0x88 [musb_hdrc]) from [<bf057d18>] (musb_probe+0xb50/0xe3c [musb_hdrc])
|[<bf057d18>] (musb_probe+0xb50/0xe3c [musb_hdrc]) from [<c01779c4>] (platform_drv_probe+0x1c/0x24)

The problem is that musb_free() tries to figure out what was
initializued and what wasn't and clean up only the initialized part.
This works well for usb_del_gadget_udc() but device_unregister() can't
deal with it. Therefore we rely on the fact the we always have a parent
device and only then remove the device.
I broke this in 0f91349 ("usb: gadget: convert all users to the new udc
infrastructure")

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-08-12 12:06:34 +03:00
..
Kconfig usb: musb: fix Kconfig 2011-08-12 11:52:36 +03:00
Makefile usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
am35x.c usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
blackfin.c usb: musb: blackfin: include prefetch head file 2011-08-12 11:52:51 +03:00
blackfin.h usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
cppi_dma.c usb: musb: cppi: fix build errors due to DBG and missing musb variable 2011-08-12 11:52:47 +03:00
cppi_dma.h
da8xx.c usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
davinci.c usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
davinci.h
musb_core.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2011-07-25 23:08:32 -07:00
musb_core.h usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
musb_debug.h
musb_debugfs.c
musb_dma.h
musb_gadget.c usb: musb: gadget: fix error path 2011-08-12 12:06:34 +03:00
musb_gadget.h
musb_gadget_ep0.c usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
musb_host.c usb: musb: host: compare status for negative error values 2011-06-09 12:01:03 +03:00
musb_host.h usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
musb_io.h
musb_regs.h usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
musb_virthub.c usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
musbhsdma.c
musbhsdma.h
omap2430.c usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
omap2430.h
tusb6010.c usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
tusb6010.h
tusb6010_omap.c usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
ux500.c
ux500_dma.c usb: musb: ux500: replace missing DBG with dev_dbg 2011-08-12 11:52:46 +03:00