From: Adrian Hunter Date: Tue, 21 Jan 2014 07:52:39 +0000 (+0200) Subject: mmc: sdhci-pci: Fix possibility of chip->fixes being null X-Git-Tag: v3.12.11~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8786a04f4db6cb6dd92f28b2f81737d290ba30b;p=thirdparty%2Fkernel%2Fstable.git mmc: sdhci-pci: Fix possibility of chip->fixes being null commit 945be38caa287b177b8c17ffaae7754cab6a658f upstream. It is possible for chip->fixes to be null. Check before dereferencing it. Signed-off-by: Adrian Hunter Signed-off-by: Chris Ball Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 33593e7a64574..27ae563d0caa4 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c @@ -1389,7 +1389,8 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot( * from runtime suspend. If it is not there, don't allow runtime PM. * Note sdhci_pci_add_own_cd() sets slot->cd_gpio to -EINVAL on failure. */ - if (chip->fixes->own_cd_for_runtime_pm && !gpio_is_valid(slot->cd_gpio)) + if (chip->fixes && chip->fixes->own_cd_for_runtime_pm && + !gpio_is_valid(slot->cd_gpio)) chip->allow_runtime_pm = false; return slot;