diff options
| author | Amandeep Singh <amansing@codeaurora.org> | 2019-09-11 13:02:17 +0530 |
|---|---|---|
| committer | Amandeep Singh <amansing@codeaurora.org> | 2019-09-12 15:19:57 +0530 |
| commit | 8ed99bcd175ed88b296e7cdba16232ffb9bd7ea4 (patch) | |
| tree | 8d320f860e797f37282f8b59ff426898ea6a510a | |
| parent | ffc3c271c99d14878839caeedeeef152a27c13ea (diff) | |
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>
| -rw-r--r-- | include/linux/mmc/host.h | 4 |
1 files 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) |
