usb: gadget: Do not disconnect unregistered dev
authorBadhri Jagan Sridharan <Badhri@google.com>
Wed, 6 May 2015 20:40:15 +0000 (13:40 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:52:11 +0000 (13:52 -0800)
commit1c9137c8c53cf4af32f33ac1d8d2c9675009991b
treed4b5407068f1c2913d956393a4c89d7285fc3622
parente1cc1e2a3771d90ac2ec42e3219fae2f2ca1ffc7
usb: gadget: Do not disconnect unregistered dev

configfs_composite_unbind sets the gadget data
to null. Therefore, add check in disconnect
function to make sure that cdev is not NULL.
Prints a WARN message if the driver tries to
redundantly disconnect a gadget.

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I248cb7175d0dd9a51c18053dd39475d8b3284f6d
drivers/usb/gadget/composite.c