diff options
| author | Xinyu Chen <xinyu.chen@freescale.com> | 2009-08-16 22:09:18 +0800 |
|---|---|---|
| committer | Xinyu Chen <xinyu.chen@freescale.com> | 2009-08-16 22:19:36 +0800 |
| commit | e3530471bf69c2326baed3a6865e396822522c7b (patch) | |
| tree | f32529d6f0f757725d31f690e854c35d391666ce /vold | |
| parent | 227c74af84f6612559bfb3dceeac324c8ef30870 (diff) | |
| download | system_core-e3530471bf69c2326baed3a6865e396822522c7b.tar.gz system_core-e3530471bf69c2326baed3a6865e396822522c7b.tar.bz2 system_core-e3530471bf69c2326baed3a6865e396822522c7b.zip | |
Fix bug of mmc.c not checking read_file result.
This bug causes segment fault when reading name node of
SDIO mmc device's /sys file, which is not existed at all.
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
Diffstat (limited to 'vold')
| -rw-r--r-- | vold/mmc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -158,6 +158,10 @@ static int mmc_bootstrap_card(char *sysfs_path) sprintf(filename, "/sys%s/name", devpath); p = read_file(filename, &sz); + if (!p) { + LOGE("Unable to read MMC name: %s", filename); + return -errno; + } p[strlen(p) - 1] = '\0'; sprintf(tmp, "MMC_NAME=%s", p); free(p); |
