[linux-yocto] [PATCH 1/1] sdhci-pci.c: a fix for invalid memory access

nitin.a.kamble at intel.com nitin.a.kamble at intel.com
Mon Mar 31 13:24:18 PDT 2014


From: Nitin A Kamble <nitin.a.kamble at intel.com>

The chip->fixes pointer is assumed to be a valid data pointer, which is
not always the case. For example this code was giving a kernel panic for
emenlow BSP, because the fixes pointer is NULL.

Signed-off-by: Nitin A Kamble <nitin.a.kamble at intel.com>
---
 drivers/mmc/host/sdhci-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 33593e7..b7c8e20 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -1389,7 +1389,7 @@ 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;
-- 
1.8.1.4



More information about the linux-yocto mailing list