usb: gadget: f_fs: add extra check before unregister_gadget_item
authorRui Miguel Silva <rui.silva@linaro.org>
Wed, 20 May 2015 13:52:40 +0000 (14:52 +0100)
committerFelipe Balbi <balbi@ti.com>
Tue, 26 May 2015 15:39:34 +0000 (10:39 -0500)
commitf14e9ad17f46051b02bffffac2036486097de19e
treea1eb00b51af11edccff8c170d43857c6d324f269
parent76e838c9f7765f9a6205b4d558d75a66104bc60d
usb: gadget: f_fs: add extra check before unregister_gadget_item

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>
drivers/usb/gadget/function/f_fs.c