OpenCloudOS-Kernel/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 headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
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 USB: musb: partial DaVinci dm355 support 2009-03-24 16:20:36 -07:00
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 usb: musb: drop unneeded musb_debug trickery 2011-05-13 14:34:04 +03:00
musb_debugfs.c headers: kobject.h redux 2011-01-10 08:51:44 -08:00
musb_dma.h usb: musb: introduce api for dma code to check compatibility with usb request 2011-02-01 10:41:30 +02:00
musb_gadget.c usb: musb: gadget: fix error path 2011-08-12 12:06:34 +03:00
musb_gadget.h usb: musb: gadget: do not poke with gadget's list_head 2011-02-17 21:11:46 +02:00
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 usb: musb: add Kconfig options for each glue layer 2010-12-10 10:21:09 +02:00
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 usb: musb: drop unneeded musb_debug trickery 2011-05-13 14:34:04 +03:00
musbhsdma.h Merge branches 'devel-cleanup', 'devel-board', 'devel-early-init' and 'devel-ti816x' into omap-for-linus 2011-02-16 11:32:38 -08:00
omap2430.c usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
omap2430.h USB: musb: get rid of omap_readl/writel 2010-03-02 14:54:38 -08:00
tusb6010.c usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
tusb6010.h USB: musb: Remove my email address from few musb related drivers 2009-04-23 14:15:27 -07:00
tusb6010_omap.c usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
ux500.c usb: musb: ux500: copy dma mask from platform device to musb device 2011-04-13 11:50:57 +03:00
ux500_dma.c usb: musb: ux500: replace missing DBG with dev_dbg 2011-08-12 11:52:46 +03:00