lkml.org 
[lkml]   [2015]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 05/23] usb: gadget: configfs: fix error path
    Date
    As usb_gstrings_attach() fail can happen when some USB functions are
    are already added to some configurations (in prevoius loop iterations),
    we should always call purge_configs_funcs() to be sure that failure is
    be handled properly.

    Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
    ---
    drivers/usb/gadget/configfs.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
    index 294eb74..d2101d8 100644
    --- a/drivers/usb/gadget/configfs.c
    +++ b/drivers/usb/gadget/configfs.c
    @@ -1411,7 +1411,7 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
    s = usb_gstrings_attach(&gi->cdev, cfg->gstrings, 1);
    if (IS_ERR(s)) {
    ret = PTR_ERR(s);
    - goto err_comp_cleanup;
    + goto err_purge_funcs;
    }
    c->iConfiguration = s[0].id;
    }
    --
    1.9.1


    \
     
     \ /
      Last update: 2015-11-03 14:21    [W:4.322 / U:0.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site