summaryrefslogtreecommitdiff
path: root/umount.c
diff options
context:
space:
mode:
Diffstat (limited to 'umount.c')
-rw-r--r--umount.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/umount.c b/umount.c
index 061bb9b..3bd8681 100644
--- a/umount.c
+++ b/umount.c
@@ -73,8 +73,13 @@ umount_all(int useMtab)
while ((m = getmntent (mountTable)) != 0) {
char *blockDevice = m->mnt_fsname;
#if ! defined BB_MTAB
- if (strcmp (blockDevice, "/dev/root") == 0)
- blockDevice = (getfsfile ("/"))->fs_spec;
+ if (strcmp (blockDevice, "/dev/root") == 0) {
+ struct fstab* fstabItem;
+ fstabItem = getfsfile ("/");
+ if (fstabItem != NULL) {
+ blockDevice = fstabItem->fs_spec;
+ }
+ }
#endif
/* Don't umount /proc when doing umount -a */
if (strcmp (blockDevice, "proc") == 0)