]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: gadgetfs: correct dev state
authorMarcus Nutzinger <marcus.nutzinger@theobroma-systems.com>
Thu, 5 Jun 2014 15:17:06 +0000 (17:17 +0200)
committerFelipe Balbi <balbi@ti.com>
Thu, 19 Jun 2014 15:11:14 +0000 (10:11 -0500)
commitdb0c21cb11a6e26d9c179163831e6493aef3be56
treeec58317828c265211d09b214e666c36b8b53075c
parent8e74cb87a3c8378f45acb0fcb3df7ae720ff4bbd
usb: gadget: gadgetfs: correct dev state

This reverts commit a0c7890e (usb: gadget: gadgetfs: use
after free in dev_release()) and places the call to
put_dev() after setting the state.

If this is not the final call to dev_release() and the
state is not reset to STATE_DEV_DISABLED and hence all
further open() calls to the gadgetfs ep0 device will
fail with EBUSY.

Signed-off-by: Marcus Nutzinger <marcus.nutzinger@theobroma-systems.com>
Reviewed-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/inode.c