mfd: rtsx: Fix oops when rtsx_pci_sdmmc is not probed
If rtsx_pci_sdmmc is not probed, function pointer pcr->slots[].card_event will point to NULL, and thus rtsx_pci_card_detect will reference a NULL pointer. Check card_event pointer before referencing it can avoid kernel panic. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
ff0decd493
commit
2d1484f599
|
@ -786,10 +786,10 @@ static void rtsx_pci_card_detect(struct work_struct *work)
|
|||
|
||||
spin_unlock_irqrestore(&pcr->lock, flags);
|
||||
|
||||
if (card_detect & SD_EXIST)
|
||||
if ((card_detect & SD_EXIST) && pcr->slots[RTSX_SD_CARD].card_event)
|
||||
pcr->slots[RTSX_SD_CARD].card_event(
|
||||
pcr->slots[RTSX_SD_CARD].p_dev);
|
||||
if (card_detect & MS_EXIST)
|
||||
if ((card_detect & MS_EXIST) && pcr->slots[RTSX_MS_CARD].card_event)
|
||||
pcr->slots[RTSX_MS_CARD].card_event(
|
||||
pcr->slots[RTSX_MS_CARD].p_dev);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue