UBI: return correct error code
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sun, 14 Oct 2007 10:01:58 +0000 (13:01 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sun, 14 Oct 2007 10:10:21 +0000 (13:10 +0300)
Fix the following warning:

drivers/mtd/ubi/eba.c: In function 'ubi_eba_init_scan':
drivers/mtd/ubi/eba.c:1116: warning: 'err' may be used uninitialized in this function

Pointed-to-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/eba.c

index 7b7add6da12f31aeac6fab06299e6167e981f46a..1297732f4db95c4275e9f3f78b81345d48787572 100644 (file)
@@ -1188,6 +1188,7 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si)
        if (ubi->avail_pebs < EBA_RESERVED_PEBS) {
                ubi_err("no enough physical eraseblocks (%d, need %d)",
                        ubi->avail_pebs, EBA_RESERVED_PEBS);
+               err = -ENOSPC;
                goto out_free;
        }
        ubi->avail_pebs -= EBA_RESERVED_PEBS;