Skip to content

Commit c28a553

Browse files
ahunter6gregkh
authored andcommitted
mmc: sdhci-pci: Fix possibility of chip->fixes being null
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>
1 parent 0a3ce0f commit c28a553

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/mmc/host/sdhci-pci.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,8 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
14661466
* from runtime suspend. If it is not there, don't allow runtime PM.
14671467
* Note sdhci_pci_add_own_cd() sets slot->cd_gpio to -EINVAL on failure.
14681468
*/
1469-
if (chip->fixes->own_cd_for_runtime_pm && !gpio_is_valid(slot->cd_gpio))
1469+
if (chip->fixes && chip->fixes->own_cd_for_runtime_pm &&
1470+
!gpio_is_valid(slot->cd_gpio))
14701471
chip->allow_runtime_pm = false;
14711472

14721473
return slot;

0 commit comments

Comments
 (0)