Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 945be38c authored by Adrian Hunter's avatar Adrian Hunter Committed by Chris Ball
Browse files

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



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

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Cc: stable <stable@vger.kernel.org> # 3.11+
Signed-off-by: default avatarChris Ball <chris@printf.net>
parent 77a0122e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1378,7 +1378,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;