From 8ed99bcd175ed88b296e7cdba16232ffb9bd7ea4 Mon Sep 17 00:00:00 2001 From: Amandeep Singh Date: Wed, 11 Sep 2019 13:02:17 +0530 Subject: [PATCH] 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 --- include/linux/mmc/host.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 49648aa63ee3..2dff3db6e4f3 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -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)