summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/inode.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-08-23 11:14:49 +0300
committerFelipe Balbi <balbi@ti.com>2013-08-27 15:03:28 -0500
commit1826e9b1bd9139850954acb9c2e0fb230ba94e0d (patch)
tree8d5b125b22ea01d125ab716f89583c7a769679a1 /drivers/usb/gadget/inode.c
parentc078a37652477e1b08318df8fe403e02cac5138d (diff)
downloadblackbird-op-linux-1826e9b1bd9139850954acb9c2e0fb230ba94e0d.tar.gz
blackbird-op-linux-1826e9b1bd9139850954acb9c2e0fb230ba94e0d.zip
usb: gadget: gadgetfs: use after free in dev_release()
The call to put_dev() releases "dev". Hopefully, we don't need to set the state to STATE_DEV_DISABLED anyway so I have removed those lines. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/inode.c')
-rw-r--r--drivers/usb/gadget/inode.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 570c005062ab..465ef8e2cc91 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1270,10 +1270,6 @@ dev_release (struct inode *inode, struct file *fd)
dev->buf = NULL;
put_dev (dev);
- /* other endpoints were all decoupled from this device */
- spin_lock_irq(&dev->lock);
- dev->state = STATE_DEV_DISABLED;
- spin_unlock_irq(&dev->lock);
return 0;
}
OpenPOWER on IntegriCloud