greybus: don't assume subdevs are valid
authorAlex Elder <elder@linaro.org>
Thu, 16 Oct 2014 11:35:24 +0000 (06:35 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 17 Oct 2014 16:11:59 +0000 (18:11 +0200)
commit051fb04712593a1bebdf638cd9f9935db2ce48aa
treea40218b835139c8b330bb93ba6267de9a727b2fe
parent8fd39e3dcb881501726ed0161855ed7a61f642ef
greybus: don't assume subdevs are valid

Most of the disconnect routines for the "subdevs" of a module
blindly assume that initialization of the subdev was successful.

Fix this by checking for null pointers.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/battery-gb.c
drivers/staging/greybus/gpio-gb.c
drivers/staging/greybus/i2c-gb.c
drivers/staging/greybus/sdio-gb.c