Commit 14794d71 authored by Felipe F. Tonello's avatar Felipe F. Tonello Committed by Felipe Balbi

usb: gadget: f_hid: use free_ep_req()

We should always use free_ep_req() when allocating requests with
alloc_ep_req().
Signed-off-by: default avatarFelipe F. Tonello <eu@felipetonello.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent aadbe812
...@@ -677,11 +677,8 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -677,11 +677,8 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)
usb_free_all_descriptors(f); usb_free_all_descriptors(f);
fail: fail:
ERROR(f->config->cdev, "hidg_bind FAILED\n"); ERROR(f->config->cdev, "hidg_bind FAILED\n");
if (hidg->req != NULL) { if (hidg->req != NULL)
kfree(hidg->req->buf); free_ep_req(hidg->in_ep, hidg->req);
if (hidg->in_ep != NULL)
usb_ep_free_request(hidg->in_ep, hidg->req);
}
return status; return status;
} }
...@@ -920,8 +917,7 @@ static void hidg_unbind(struct usb_configuration *c, struct usb_function *f) ...@@ -920,8 +917,7 @@ static void hidg_unbind(struct usb_configuration *c, struct usb_function *f)
/* disable/free request and end point */ /* disable/free request and end point */
usb_ep_disable(hidg->in_ep); usb_ep_disable(hidg->in_ep);
kfree(hidg->req->buf); free_ep_req(hidg->in_ep, hidg->req);
usb_ep_free_request(hidg->in_ep, hidg->req);
usb_free_all_descriptors(f); usb_free_all_descriptors(f);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment