summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/legacy
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2020-05-13 21:01:42 +0300
committerFelipe Balbi <balbi@kernel.org>2020-05-14 12:35:41 +0300
commitda39b5ee40bc00ae3edb4ae4e205b10bc52f980e (patch)
tree3131e729c83e48986abb873aa888f9071019c3f7 /drivers/usb/gadget/legacy
parent61d2658db48af0c563d126cccc5c1105137b1ec9 (diff)
downloadlinux-da39b5ee40bc00ae3edb4ae4e205b10bc52f980e.tar.xz
usb: raw-gadget: fix null-ptr-deref when reenabling endpoints
Currently we preassign gadget endpoints to raw-gadget endpoints during initialization. Fix resetting this assignment in raw_ioctl_ep_disable(), otherwise we will get null-ptr-derefs when an endpoint is reenabled. Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/gadget/legacy')
-rw-r--r--drivers/usb/gadget/legacy/raw_gadget.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/usb/gadget/legacy/raw_gadget.c b/drivers/usb/gadget/legacy/raw_gadget.c
index d73ba77014c8..e01e366d89cd 100644
--- a/drivers/usb/gadget/legacy/raw_gadget.c
+++ b/drivers/usb/gadget/legacy/raw_gadget.c
@@ -867,7 +867,6 @@ static int raw_ioctl_ep_disable(struct raw_dev *dev, unsigned long value)
spin_lock_irqsave(&dev->lock, flags);
usb_ep_free_request(dev->eps[i].ep, dev->eps[i].req);
kfree(dev->eps[i].ep->desc);
- dev->eps[i].ep = NULL;
dev->eps[i].state = STATE_EP_DISABLED;
dev->eps[i].disabling = false;