Skip to content

Commit

Permalink
usb: gadget: tcm_usb_gadge: fix to return error or 0 in tcm_usbg_drop…
Browse files Browse the repository at this point in the history
…_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>
  • Loading branch information
Wei Yongjun authored and Felipe Balbi committed Dec 13, 2012
1 parent 25e14c1 commit 5dbd693
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/gadget/tcm_usb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5dbd693

Please sign in to comment.