msm: mmc: Check card structure for NULL pointer

Check card structure for NULL pointer before dereferencing it to
check for asynchronous interrupt support.

Change-Id: Ie433d076c4624616a0fceb02b7d9754116669da4
Signed-off-by: Amandeep Singh <amansing@codeaurora.org>
This commit is contained in:
Amandeep Singh 2019-09-11 13:02:17 +05:30
parent ffc3c271c9
commit 8ed99bcd17

View file

@ -735,8 +735,8 @@ static inline int mmc_boot_partition_access(struct mmc_host *host)
static inline bool mmc_card_and_host_support_async_int(struct mmc_host *host)
{
return ((host->caps2 & MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE) &&
(host->card->cccr.async_intr_sup));
return (host->card && (host->caps2 & MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE)
&& (host->card->cccr.async_intr_sup));
}
static inline int mmc_host_uhs(struct mmc_host *host)