Browse Source

[Components][SDIO][MMC] fix null point check

ZYH 6 năm trước cách đây
mục cha
commit
780f538525
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      components/drivers/sdio/mmc.c

+ 6 - 0
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;