X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fyaffsfs.c;h=d1e4e4efa76185ade34bffeef842c6044e53fca6;hp=2c1ac42eba1c8cefad544e6c8f7d79d37d96674e;hb=HEAD;hpb=fd1de40165e91775b8af30029f8cec198d4ed665 diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index 2c1ac42..823f7ed 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -3110,14 +3110,17 @@ int yaffs_unmount2_common(struct yaffs_dev *dev, const YCHAR *path, int force) { int retVal = -1; - if (yaffsfs_CheckMemRegion(path, 0, 0) < 0) { - yaffsfs_SetError(-EFAULT); - return -1; - } - if (yaffsfs_CheckPath(path) < 0) { - yaffsfs_SetError(-ENAMETOOLONG); - return -1; + if (!dev) { + if (yaffsfs_CheckMemRegion(path, 0, 0) < 0) { + yaffsfs_SetError(-EFAULT); + return -1; + } + + if (yaffsfs_CheckPath(path) < 0) { + yaffsfs_SetError(-ENAMETOOLONG); + return -1; + } } yaffsfs_Lock();