From: Artem Bityutskiy Date: Sun, 14 Oct 2007 10:01:58 +0000 (+0300) Subject: UBI: return correct error code X-Git-Tag: v2.6.24-rc1~1324^2^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc5f4f28755b3b152297fd7bc3e03781dd8008e2;p=linux-2.6 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 Signed-off-by: Artem Bityutskiy --- diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index 7b7add6da1..1297732f4d 100644 --- a/drivers/mtd/ubi/eba.c +++ b/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;