diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/ubi/scan.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 473f3200b868..e4456869e753 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
@@ -1310,8 +1310,10 @@ static int paranoid_check_si(const struct ubi_device *ubi, | |||
1310 | memset(buf, 1, ubi->peb_count); | 1310 | memset(buf, 1, ubi->peb_count); |
1311 | for (pnum = 0; pnum < ubi->peb_count; pnum++) { | 1311 | for (pnum = 0; pnum < ubi->peb_count; pnum++) { |
1312 | err = ubi_io_is_bad(ubi, pnum); | 1312 | err = ubi_io_is_bad(ubi, pnum); |
1313 | if (err < 0) | 1313 | if (err < 0) { |
1314 | kfree(buf); | ||
1314 | return err; | 1315 | return err; |
1316 | } | ||
1315 | else if (err) | 1317 | else if (err) |
1316 | buf[pnum] = 0; | 1318 | buf[pnum] = 0; |
1317 | } | 1319 | } |