io.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) io.c (88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) International Business Machines Corp., 2006
4 * Copyright (c) Nokia Corporation, 2006, 2007
5 *
6 * Author: Artem Bityutskiy (Битюцкий Артём)
7 */
8

--- 1283 unchanged lines hidden (view full) ---

1292 int err, i;
1293 size_t read;
1294 void *buf1;
1295 loff_t addr = (loff_t)pnum * ubi->peb_size + offset;
1296
1297 if (!ubi_dbg_chk_io(ubi))
1298 return 0;
1299
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) International Business Machines Corp., 2006
4 * Copyright (c) Nokia Corporation, 2006, 2007
5 *
6 * Author: Artem Bityutskiy (Битюцкий Артём)
7 */
8

--- 1283 unchanged lines hidden (view full) ---

1292 int err, i;
1293 size_t read;
1294 void *buf1;
1295 loff_t addr = (loff_t)pnum * ubi->peb_size + offset;
1296
1297 if (!ubi_dbg_chk_io(ubi))
1298 return 0;
1299
1300 buf1 = __vmalloc(len, GFP_NOFS, PAGE_KERNEL);
1300 buf1 = __vmalloc(len, GFP_NOFS);
1301 if (!buf1) {
1302 ubi_err(ubi, "cannot allocate memory to check writes");
1303 return 0;
1304 }
1305
1306 err = mtd_read(ubi->mtd, addr, len, &read, buf1);
1307 if (err && !mtd_is_bitflip(err))
1308 goto out_free;

--- 47 unchanged lines hidden (view full) ---

1356 size_t read;
1357 int err;
1358 void *buf;
1359 loff_t addr = (loff_t)pnum * ubi->peb_size + offset;
1360
1361 if (!ubi_dbg_chk_io(ubi))
1362 return 0;
1363
1301 if (!buf1) {
1302 ubi_err(ubi, "cannot allocate memory to check writes");
1303 return 0;
1304 }
1305
1306 err = mtd_read(ubi->mtd, addr, len, &read, buf1);
1307 if (err && !mtd_is_bitflip(err))
1308 goto out_free;

--- 47 unchanged lines hidden (view full) ---

1356 size_t read;
1357 int err;
1358 void *buf;
1359 loff_t addr = (loff_t)pnum * ubi->peb_size + offset;
1360
1361 if (!ubi_dbg_chk_io(ubi))
1362 return 0;
1363
1364 buf = __vmalloc(len, GFP_NOFS, PAGE_KERNEL);
1364 buf = __vmalloc(len, GFP_NOFS);
1365 if (!buf) {
1366 ubi_err(ubi, "cannot allocate memory to check for 0xFFs");
1367 return 0;
1368 }
1369
1370 err = mtd_read(ubi->mtd, addr, len, &read, buf);
1371 if (err && !mtd_is_bitflip(err)) {
1372 ubi_err(ubi, "err %d while reading %d bytes from PEB %d:%d, read %zd bytes",

--- 24 unchanged lines hidden ---
1365 if (!buf) {
1366 ubi_err(ubi, "cannot allocate memory to check for 0xFFs");
1367 return 0;
1368 }
1369
1370 err = mtd_read(ubi->mtd, addr, len, &read, buf);
1371 if (err && !mtd_is_bitflip(err)) {
1372 ubi_err(ubi, "err %d while reading %d bytes from PEB %d:%d, read %zd bytes",

--- 24 unchanged lines hidden ---