summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2013-08-08 09:43:28 +0200
committerFelipe Balbi <balbi@ti.com>2013-08-27 14:06:08 -0500
commit5a68e9b57b1c1984dae8a9625bbf1a505d166035 (patch)
treece6ef1222336cbab1632701bce216f7cf4c41c93 /mm
parent154547c4fe0fbe92185e69a6cdc2b0502b361995 (diff)
downloadlinux-5a68e9b57b1c1984dae8a9625bbf1a505d166035.tar.gz
linux-5a68e9b57b1c1984dae8a9625bbf1a505d166035.tar.bz2
linux-5a68e9b57b1c1984dae8a9625bbf1a505d166035.zip
usb: gadget: configfs: keep a function if it is not successfully added
If usb_add_function() fails then the currently processed function is already not in the list in struct config_usb_cfg, and neither is it in the list in struct usb_configuration. At the err_purge_funcs label the purge_config_funcs() is called, which iterates over all configurations, and in each configuration it iterates over all _successfully_ added functions, and moves them back from the list in struct usb_configuration to the list in struct config_usb_cfg. BUT the function which has just failed adding and caused the unwind process is not taken care of and is effectively lost. This patch modifies the configfs_composite_bind() function so that if the usb_add_function() fails, then the currently processed function is returned to the list in struct config_usb_cfg. It would be tempting to delay the list_del() in question after usb_add_function() invocation, but a struct list_head (&f->list) cannot be stored in more than one list at the same time, so the list_del() must be called before usb_add_function(). Hence, the solution is to list_add() after usb_add_function() in case of error. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions