linux/drivers/usb/gadget
Michal Nazarewicz b894f60a23 USB: gadget: f_mass_storage: stale common->fsg value bug fix
On fsg_unbind the common->fsg pointer was not NULLed if the
unbound fsg_dev instance was the current one.  As an effect,
the incorrect pointer was preserved in all further operations
which caused do_set_interface to reference an invalid region.

This commit fixes this by raising an exception in fsg_bind
which will change the common->fsg pointer.  This also requires
an wait queue so that the thread in fsg_bind can wait till the
worker thread handles the exception.

This commit removes also a config and new_config fields of
fsg_common as they are no longer needed since fsg can be
used to determine whether function is active or not.

Moreover, this commit removes possible race condition where
the fsg field was modified in both the worker thread and
form various other contexts.  This is fixed by replacing
prev_fsg with new_fsg.  At this point, fsg is assigned only
in worker thread.

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-30 08:16:07 -07:00
..
amd5536udc.c
amd5536udc.h
at91_udc.c Merge branch 'devel-stable' into devel 2010-05-17 17:24:04 +01:00
at91_udc.h
atmel_usba_udc.c USB: gadget: Use kmemdup 2010-05-20 13:21:49 -07:00
atmel_usba_udc.h
audio.c
cdc2.c
ci13xxx_udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ci13xxx_udc.h
composite.c USB: gadget: Allow function access to device ID data during bind() 2010-05-20 13:21:43 -07:00
config.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
dummy_hcd.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
epautoconf.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
ether.c
f_acm.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
f_audio.c usb/gadget: Replace the old USB audio FU definitions in f_audio.c 2010-06-01 07:42:03 +02:00
f_ecm.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
f_eem.c USB: gadget eth: Fix calculate CRC32 in EEM 2010-06-30 08:16:06 -07:00
f_fs.c USB: gadget: f_fs.c needs to include pagemap.h 2010-05-20 13:21:44 -07:00
f_hid.c USB: gadget: add HID gadget driver 2010-05-20 13:21:35 -07:00
f_loopback.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_mass_storage.c USB: gadget: f_mass_storage: stale common->fsg value bug fix 2010-06-30 08:16:07 -07:00
f_obex.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_phonet.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_rndis.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
f_serial.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_sourcesink.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_subset.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
f_uvc.c USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
f_uvc.h USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
file_storage.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2010-03-04 08:15:33 -08:00
fsl_mxc_udc.c USB: mxc: gadget: remove 60mhz clock requirement for freescale mx51 usb core 2010-05-20 13:21:44 -07:00
fsl_qe_udc.c of/usb: fsl_qe_udc.c: fix build breakage 2010-06-02 21:02:40 -06:00
fsl_qe_udc.h
fsl_udc_core.c USB: mxc: gadget: Fix bitfield for calculating maximum packet size 2010-05-20 13:21:40 -07:00
fsl_usb2_udc.h
g_ffs.c USB: gadget: g_fs: possible invalid pointer reference bug fixed 2010-06-30 08:16:05 -07:00
g_zero.h
gadget_chips.h USB: gadget: add gadget controller number for s3c-hsotg driver 2010-03-19 07:24:22 -07:00
gmidi.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
goku_udc.c USB: goku_udc: remove potential null dereference 2010-03-19 07:24:19 -07:00
goku_udc.h
hid.c USB: g_hid: unregister platform driver on probe/usb_composite_register errors 2010-05-20 13:21:40 -07:00
imx_udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
imx_udc.h
inode.c
Kconfig USB: s3c_hsotg: define USB_GADGET_DUALSPEED in Kconfig 2010-06-04 13:16:19 -07:00
langwell_udc.c
langwell_udc.h
lh7a40x_udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
lh7a40x_udc.h
m66592-udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
m66592-udc.h usb: gadget: m66592-udc pio to mmio accessor conversion. 2010-06-02 16:26:13 +09:00
Makefile USB: mxc: gadget: remove 60mhz clock requirement for freescale mx51 usb core 2010-05-20 13:21:44 -07:00
mass_storage.c
multi.c USB: gadget/multi: cdc_do_config: remove redundant check 2010-03-19 07:24:24 -07:00
ndis.h
net2280.c
net2280.h
nokia.c
omap_udc.c
omap_udc.h
printer.c USB: gadget/printer, fix sleep inside atomic 2010-06-30 08:16:06 -07:00
pxa25x_udc.c
pxa25x_udc.h
pxa27x_udc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pxa27x_udc.h USB: pxa27x_udc: use four bits to store endpoint addresses 2010-05-20 13:21:36 -07:00
r8a66597-udc.c usb: gadget: r8a66597-udc pio to mmio accessor conversion. 2010-06-02 16:31:02 +09:00
r8a66597-udc.h usb: gadget: r8a66597-udc pio to mmio accessor conversion. 2010-06-02 16:31:02 +09:00
rndis.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
rndis.h
s3c2410_udc.c USB: s3c2410: deactivate endpoints before gadget unbinding 2010-06-30 08:16:06 -07:00
s3c2410_udc.h
s3c-hsotg.c USB: s3c-hsotg: Ensure FIFOs are fully flushed after layout 2010-06-04 13:16:19 -07:00
serial.c
storage_common.c sanitize vfs_fsync calling conventions 2010-05-21 18:31:21 -04:00
u_audio.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
u_audio.h
u_ether.c USB: gadget: __init and __exit tags removed 2010-05-20 13:21:43 -07:00
u_ether.h
u_phonet.h
u_serial.c USB: g_serial: fix tty cleanup on unload 2010-06-30 08:16:05 -07:00
u_serial.h
usbstring.c
uvc_queue.c USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
uvc_queue.h USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
uvc_v4l2.c USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
uvc_video.c USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
uvc.h USB gadget: video class function driver 2010-05-20 13:21:41 -07:00
webcam.c USB gadget: Webcam device 2010-05-20 13:21:42 -07:00
zero.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00