Commit b8786a04 authored by Adrian Hunter's avatar Adrian Hunter Committed by Greg Kroah-Hartman

mmc: sdhci-pci: Fix possibility of chip->fixes being null

commit 945be38c upstream.

It is possible for chip->fixes to be null.  Check before dereferencing it.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarChris Ball <chris@printf.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1fb1e637
...@@ -1389,7 +1389,8 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot( ...@@ -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. * 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. * 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; chip->allow_runtime_pm = false;
return slot; return slot;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment