mmc: cd-gpio: protect against NULL context in mmc_cd_gpio_free()
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Tue, 24 Apr 2012 15:56:29 +0000 (17:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2012 07:18:27 +0000 (15:18 +0800)
commit6cd4efb3a17356075c8e3f1bd191b4d120714851
treeb7c58b03e54ed5f2dcd1930674c7caf72e2e77ba
parent11c8c735ebf68c754bdd94cebd307a96fcd95068
mmc: cd-gpio: protect against NULL context in mmc_cd_gpio_free()

commit 0e9f480bb553d39ee06ccd45639ba7a5446a7b81 upstream.

Do not oops, even if mmc_cd_gpio_free() is mistakenly called on a driver
cleanup path, even though a previous call to mmc_cd_gpio_request() failed.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
[stable@: please apply to 3.3-stable]
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/core/cd-gpio.c