Skip to content

Commit

Permalink
mmc: sdhci-pci: Fix possibility of chip->fixes being null
Browse files Browse the repository at this point in the history
commit 945be38 upstream.

It is possible for chip->fixes to be null.  Check before dereferencing it.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <chris@printf.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Adrian Hunter authored and Greg Kroah-Hartman committed Feb 13, 2014
1 parent 1fb1e63 commit b8786a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mmc/host/sdhci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b8786a0

Please sign in to comment.