gadgetfs: use after free in dev_release()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
---
Static checker stuff. I haven't tested this, but I'm pretty sure it's correct.
drivers/usb/gadget/inode.c +0 -4
@@ -1269,10 +1269,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 ; }