summaryrefslogtreecommitdiffstats
path: root/vold
diff options
context:
space:
mode:
authorAndroid Code Review <code-review@android.com>2009-08-21 14:50:15 -0700
committerAndroid Code Review <code-review@android.com>2009-08-21 14:50:15 -0700
commit41ced0261c32705922da318408332372fb1255bc (patch)
tree87cd74e1ffb54b505560e326f1c236b466c76b31 /vold
parente36c153e25ceb2640967b8fc2ad9864b2b430b48 (diff)
parente3530471bf69c2326baed3a6865e396822522c7b (diff)
downloadcore-41ced0261c32705922da318408332372fb1255bc.tar.gz
core-41ced0261c32705922da318408332372fb1255bc.tar.bz2
core-41ced0261c32705922da318408332372fb1255bc.zip
Merge change 11205
* changes: 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.
Diffstat (limited to 'vold')
-rw-r--r--vold/mmc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vold/mmc.c b/vold/mmc.c
index fcf7c2f9e..6ad97f439 100644
--- a/vold/mmc.c
+++ b/vold/mmc.c
@@ -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);