X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=yaffs_vfs_multi.c;h=f7673155348774a3120f911d5ca1d02ad75153a1;hb=bc62199fe5f099e04e34857b346cfa89df5da1be;hp=67050d4e3d2c1f7dd7b88a946567968a203ee251;hpb=bc76682d93955cfb33051beb503ad9f8a5450578;p=yaffs2.git diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index 67050d4..f767315 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -2670,7 +2670,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, "yaffs: MTD device %u either not valid or unavailable", MINOR(sb->s_dev)); @@ -2713,15 +2713,11 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, context = kmalloc(sizeof(struct yaffs_linux_context), GFP_KERNEL); if (!dev || !context) { - if (dev) - kfree(dev); - if (context) - kfree(context); + kfree(dev); + 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 struct yaffs_dev."