linux/drivers/usb/gadget
Andrzej Pietrasiewicz 45ab460975 usb: gadget: nokia: fix error recovery path for optional functions
In the nokia gadget some USB functions (obex 1 and 2, phonet) are optional.

If at the start of nokia_bind_config e.g. fi_phonet is an error pointer,
which can happen because we don't fail the bind process if
usb_get_function_instance() fails for fi_phonet, then f_phonet is NULL, and

phonet_stat = usb_add_function(c, f_phonet);

is never called and phonet_stat remains 0.

If, in these circumstances, we hit the err_conf label then !phonet_stat
evaluates to true and we try usb_remove_function() with its second
parameter being f_phonet which is NULL and it causes NULL pointer
dereference.

This patch changes the initial values of (obex1|obex2|phonet)_stat to a
nonzero value so that if the err_conf label is hit while the respective
functions have not been acquired the usb_remove_function() is not called
for those functions.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-12-17 13:17:41 -06:00
..
acm_ms.c usb: gadget: acm_ms: convert to new interface of f_mass_storage 2013-10-10 10:24:31 -05:00
amd5536udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
amd5536udc.h
at91_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
at91_udc.h
atmel_usba_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
atmel_usba_udc.h
audio.c
bcm63xx_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
cdc2.c
composite.c usb: gadget: composite: redirect setup requests 2013-11-26 13:40:44 -06:00
config.c
configfs.c usb: gadget: configfs: allow setting function instance's name 2013-12-12 13:43:35 -06:00
configfs.h
dbgp.c
dummy_hcd.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
epautoconf.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
ether.c
f_acm.c
f_ecm.c usb: gadget: f_ecm: remove compatibility layer 2013-12-12 13:43:36 -06:00
f_eem.c
f_fs.c usb: gadget: f_fs: fix sparse warning 2013-12-12 13:43:40 -06:00
f_hid.c usb: gadget: factor out alloc_ep_req 2013-11-26 13:41:32 -06:00
f_loopback.c usb: gadget: f_loopback: add configfs support 2013-11-26 13:46:13 -06:00
f_mass_storage.c usb/gadget: f_mass_storage: use string literal as format in dev_set_name 2013-10-25 09:12:14 +01:00
f_mass_storage.h usb: gadget: f_mass_storage: remove compatibility layer 2013-10-10 10:24:53 -05:00
f_midi.c usb: gadget: factor out alloc_ep_req 2013-11-26 13:41:32 -06:00
f_ncm.c
f_obex.c
f_phonet.c
f_rndis.c usb: gadget: rndis: merge u_rndis.ko with usb_f_rndis.ko 2013-12-12 13:43:38 -06:00
f_serial.c
f_sourcesink.c usb: gadget: f_sourcesink: add configfs support 2013-11-26 13:47:41 -06:00
f_subset.c usb: gadget: f_subset: remove compatibility layer 2013-12-12 13:43:37 -06:00
f_uac1.c
f_uac2.c
f_uvc.c
f_uvc.h
fotg210-udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
fotg210.h
fsl_mxc_udc.c
fsl_qe_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
fsl_qe_udc.h
fsl_udc_core.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
fsl_usb2_udc.h
functions.c
fusb300_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
fusb300_udc.h
g_ffs.c usb: gadget: g_ffs: convert to new interface of f_fs 2013-12-12 13:43:39 -06:00
g_zero.h usb: gadget: f_sourcesink: add configfs support 2013-11-26 13:47:41 -06:00
gadget_chips.h
gmidi.c
goku_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
goku_udc.h
hid.c
inode.c
Kconfig usb: gadget: FunctionFS: add configfs support 2013-12-12 13:43:40 -06:00
lpc32xx_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
m66592-udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
m66592-udc.h
Makefile usb: gadget: FunctionFS: convert to new function interface with backward compatibility 2013-12-12 13:43:39 -06:00
mass_storage.c usb: gadget: mass_storage: convert to new interface of f_mass_storage 2013-10-10 10:24:10 -05:00
multi.c usb: gadget: multi: convert to new interface of f_mass_storage 2013-10-10 10:24:49 -05:00
mv_u3d_core.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
mv_u3d.h
mv_udc_core.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
mv_udc.h
ncm.c
ndis.h
net2272.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
net2272.h
net2280.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
net2280.h
nokia.c usb: gadget: nokia: fix error recovery path for optional functions 2013-12-17 13:17:41 -06:00
omap_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
omap_udc.h
pch_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
printer.c
pxa25x_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
pxa25x_udc.h
pxa27x_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
pxa27x_udc.h
r8a66597-udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
r8a66597-udc.h
rndis.c usb: gadget: rndis: merge u_rndis.ko with usb_f_rndis.ko 2013-12-12 13:43:38 -06:00
rndis.h
s3c2410_udc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
s3c2410_udc.h
s3c-hsotg.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
s3c-hsotg.h
s3c-hsudc.c usb: gadget: add "maxpacket_limit" field to struct usb_ep 2013-12-17 13:17:41 -06:00
serial.c
storage_common.c usb: gadget: storage_common: pass filesem to fsg_store_cdrom 2013-10-15 06:52:08 -05:00
storage_common.h usb: gadget: storage_common: pass filesem to fsg_store_cdrom 2013-10-15 06:52:08 -05:00
tcm_usb_gadget.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-11-22 10:52:03 -08:00
tcm_usb_gadget.h
u_ecm.h
u_eem.h
u_ether_configfs.h
u_ether.c usb: gadget: update some out of date comments 2013-11-26 10:58:17 -06:00
u_ether.h usb: gadget: f_rndis: remove compatibility layer 2013-12-12 13:43:37 -06:00
u_f.c usb: gadget: factor out alloc_ep_req 2013-11-26 13:41:32 -06:00
u_f.h usb: gadget: factor out alloc_ep_req 2013-11-26 13:41:32 -06:00
u_fs.h usb: gadget: FunctionFS: add configfs support 2013-12-12 13:43:40 -06:00
u_gether.h
u_ncm.h
u_phonet.h
u_rndis.h usb: gadget: rndis: merge u_rndis.ko with usb_f_rndis.ko 2013-12-12 13:43:38 -06:00
u_serial.c
u_serial.h
u_uac1.c
u_uac1.h
udc-core.c
usbstring.c
uvc_queue.c
uvc_queue.h
uvc_v4l2.c
uvc_video.c
uvc.h
webcam.c
zero.c usb: gadget: f_sourcesink: add configfs support 2013-11-26 13:47:41 -06:00