summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/legacy/dbgp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/legacy/dbgp.c')
-rw-r--r--drivers/usb/gadget/legacy/dbgp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/gadget/legacy/dbgp.c b/drivers/usb/gadget/legacy/dbgp.c
index 986fc511a2e..225e385a616 100644
--- a/drivers/usb/gadget/legacy/dbgp.c
+++ b/drivers/usb/gadget/legacy/dbgp.c
@@ -222,10 +222,12 @@ static void dbgp_unbind(struct usb_gadget *gadget)
{
#ifdef CONFIG_USB_G_DBGP_SERIAL
kfree(dbgp.serial);
+ dbgp.serial = NULL;
#endif
if (dbgp.req) {
kfree(dbgp.req->buf);
usb_ep_free_request(gadget->ep0, dbgp.req);
+ dbgp.req = NULL;
}
gadget->ep0->driver_data = NULL;