Skip to content

Commit

Permalink
usb: gadget: omap_udc: kfree(NULL) is safe
Browse files Browse the repository at this point in the history
we don't need to check for _req because
kfree(NULL) is safe. Also, if someone
actually passes a NULL pointer to be freed
by usb_ep_free_request(), he deserves any
issue he faces.

Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Jun 3, 2012
1 parent 70617db commit 23673d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/gadget/omap_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ omap_free_request(struct usb_ep *ep, struct usb_request *_req)
{
struct omap_req *req = container_of(_req, struct omap_req, req);

if (_req)
kfree(req);
kfree(req);
}

/*-------------------------------------------------------------------------*/
Expand Down

0 comments on commit 23673d7

Please sign in to comment.