From 780f538525637eaed5315c66ee1c52228c16b1d6 Mon Sep 17 00:00:00 2001 From: ZYH Date: Sat, 22 Sep 2018 15:02:48 +0800 Subject: [PATCH] [Components][SDIO][MMC] fix null point check --- components/drivers/sdio/mmc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/drivers/sdio/mmc.c b/components/drivers/sdio/mmc.c index e617c115f4..b928119b7d 100644 --- a/components/drivers/sdio/mmc.c +++ b/components/drivers/sdio/mmc.c @@ -198,6 +198,12 @@ static int mmc_get_ext_csd(struct rt_mmcsd_card *card, rt_uint8_t **new_ext_csd) */ static int mmc_parse_ext_csd(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd) { + if(RT_NULL == card || RT_NULL == ext_csd) + { + LOG_E("emmc parse ext csd fail, invaild args"); + return -1; + } + card->flags |= CARD_FLAG_HIGHSPEED; card->hs_max_data_rate = 200000000;