diff options
| author | Felipe F. Tonello <eu@felipetonello.com> | 2016-08-23 18:24:50 +0100 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-01-02 20:42:24 -0800 |
| commit | bd63c75aa4cf05d33cd1f42b6beb77a33be98029 (patch) | |
| tree | 802c74f83d147f54853a6d47cd6516da2dd800b7 | |
| parent | 556e8bd7bb18a9951a4b9840bca20b9329bad408 (diff) | |
usb: gadget: f_hid: use free_ep_req()
We should always use free_ep_req() when allocating requests with
alloc_ep_req().
Change-Id: Ifa23bf08baf00eb6a1516726de7655901a532cdc
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 14794d7133d0f16b4901207a489f04e4e700166a
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
| -rw-r--r-- | drivers/usb/gadget/function/f_hid.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index 0654d4e0184b..1c9963ffbe35 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -693,11 +693,8 @@ fail_free_descs: usb_free_all_descriptors(f); fail: ERROR(f->config->cdev, "hidg_bind FAILED\n"); - if (hidg->req != NULL) { - kfree(hidg->req->buf); - if (hidg->in_ep != NULL) - usb_ep_free_request(hidg->in_ep, hidg->req); - } + if (hidg->req != NULL) + free_ep_req(hidg->in_ep, hidg->req); return status; } @@ -936,8 +933,7 @@ static void hidg_unbind(struct usb_configuration *c, struct usb_function *f) /* disable/free request and end point */ usb_ep_disable(hidg->in_ep); - kfree(hidg->req->buf); - usb_ep_free_request(hidg->in_ep, hidg->req); + free_ep_req(hidg->in_ep, hidg->req); usb_free_all_descriptors(f); } |
