Explorar o código

UBI: return correct error code

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>
Artem Bityutskiy %!s(int64=17) %!d(string=hai) anos
pai
achega
cc5f4f2875
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      drivers/mtd/ubi/eba.c

+ 1 - 0
drivers/mtd/ubi/eba.c

@@ -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;