diff options
author | Loic Poulain <loic.poulain@linaro.org> | 2018-11-09 16:06:56 +0100 |
---|---|---|
committer | Loic Poulain <loic.poulain@linaro.org> | 2018-12-14 14:57:27 +0100 |
commit | 50e3912757c4d5edb571bf30599e37e24c0bdbf3 (patch) | |
tree | bf614386bb87f7fde7656ee54b2c500f98c5f23c | |
parent | 16abfafcbdffc6c67316af29fd44c106097b9461 (diff) |
msm_shared: rpmb: Fix NULL pointer8x96-sdcard-boot
In case of SDCARD MMC type, ext_csd is null.
Fix NULL pointer causing boot crash/freeze.
Change-Id: I432ac027f3b9d628034a9e3c90ada262b1625e98
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
-rw-r--r-- | platform/msm_shared/rpmb/rpmb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/msm_shared/rpmb/rpmb.c b/platform/msm_shared/rpmb/rpmb.c index 3c85b8dc..07976d27 100644 --- a/platform/msm_shared/rpmb/rpmb.c +++ b/platform/msm_shared/rpmb/rpmb.c @@ -52,8 +52,10 @@ int rpmb_init() { struct mmc_device *mmc_dev = (struct mmc_device *) dev; info.size = mmc_dev->card.rpmb_size / RPMB_MIN_BLK_SZ; - if (mmc_dev->card.ext_csd[MMC_EXT_CSD_REV] < 8) - { + if (MMC_CARD_SD((&mmc_dev->card))) { + /* SDCARD => no ext_csd/RPMB support */ + info.rel_wr_count = 0; + } else if (mmc_dev->card.ext_csd[MMC_EXT_CSD_REV] < 8) { dprintf(SPEW, "EMMC Version < 5.1\n"); info.rel_wr_count = mmc_dev->card.rel_wr_count; } @@ -229,5 +231,3 @@ int rpmb_uninit() return ret; } - - |