Apply fixes in cisco patch to yaffs_vfs_single
authorCharles Manning <cdhmanning@gmail.com>
Tue, 21 Jan 2014 23:32:13 +0000 (12:32 +1300)
committerCharles Manning <cdhmanning@gmail.com>
Tue, 21 Jan 2014 23:32:13 +0000 (12:32 +1300)
Cisco patched the multi version. This manually drags the fixes to the
single version too.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs_vfs_single.c

index 145517b69b165d4274037493075046c85c78ac58..232dc2625328a7173509456dcf227c7411d9da5b 100644 (file)
@@ -2033,7 +2033,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,
 
        /* Get the device */
        mtd = get_mtd_device(NULL, MINOR(sb->s_dev));
-       if (!mtd) {
+       if (IS_ERR(mtd)) {
                yaffs_trace(YAFFS_TRACE_ALWAYS,
                        "MTD device #%u doesn't appear to exist",
                        MINOR(sb->s_dev));
@@ -2127,9 +2127,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,
                kfree(context);
                dev = NULL;
                context = NULL;
-       }
 
-       if (!dev) {
                /* Deep shit could not allocate device structure */
                yaffs_trace(YAFFS_TRACE_ALWAYS,
                        "yaffs_read_super failed trying to allocate yaffs_dev");