usb: gadget: f_fs: add extra check before unregister_gadget_item
commit7fa24a821af13e4cf468e9c9e2cfeae6b71832d3
authorRui Miguel Silva <rui.silva@linaro.org>
Wed, 20 May 2015 13:52:40 +0000 (20 14:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jul 2015 16:45:39 +0000 (10 09:45 -0700)
tree5afd6e39a59ad70adad057d218a2a3fb064e034a
parent0b5531419e0537db4b9f92e1c615bf76fc55d98b
usb: gadget: f_fs: add extra check before unregister_gadget_item

commit f14e9ad17f46051b02bffffac2036486097de19e upstream.

ffs_closed can race with configfs_rmdir which will call config_item_release, so
add an extra check to avoid calling the unregister_gadget_item with an null
gadget item.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_fs.c