diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-11-14 06:47:23 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-12-13 11:04:00 +0100 |
commit | 5dbd693576726bd7d3228ee614060e0817305dde (patch) | |
tree | 1d955d16df8cf66f48f029aba790db88cb20760d | |
parent | usb: gadget: amd5536udc: avoid NULL pointer dereference in udc_pci_probe() (diff) | |
download | linux-5dbd693576726bd7d3228ee614060e0817305dde.tar.xz linux-5dbd693576726bd7d3228ee614060e0817305dde.zip |
usb: gadget: tcm_usb_gadge: fix to return error or 0 in tcm_usbg_drop_nexus()
In the error handling case of tcm_usbg_drop_nexus(), the error code
is assigned to 'ret', but it is ignored. We'd better return 'ret'
instead of always return 0.
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/gadget/tcm_usb_gadget.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c index 4f7f76f00c74..7cacd6ae818e 100644 --- a/drivers/usb/gadget/tcm_usb_gadget.c +++ b/drivers/usb/gadget/tcm_usb_gadget.c @@ -1794,9 +1794,10 @@ static int tcm_usbg_drop_nexus(struct usbg_tpg *tpg) tpg->tpg_nexus = NULL; kfree(tv_nexus); + ret = 0; out: mutex_unlock(&tpg->tpg_mutex); - return 0; + return ret; } static ssize_t tcm_usbg_tpg_store_nexus( |