USB: android: Handle error conditions in init() function

When the usb_compostite_probe function fails, the USB enumeration fails.
Hence accessing the USB related sysfs entries results in null pointer
dereference crash.

This change fixes it by handling all possible error conditions and
destroy the sysfs entries in the init() function.

Change-Id: Ic9cb569eef2d4076aff1acd8fc679bc762f300f7
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
1 file changed