summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/tests/mtd_readtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/tests/mtd_readtest.c')
-rw-r--r--drivers/mtd/tests/mtd_readtest.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index 266de04..2cdd0c4 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -143,10 +143,8 @@ static int scan_for_bad_eraseblocks(void)
int i, bad = 0;
bbt = kzalloc(ebcnt, GFP_KERNEL);
- if (!bbt) {
- pr_err("error: cannot allocate memory\n");
+ if (!bbt)
return -ENOMEM;
- }
if (!mtd_can_have_bb(mtd))
return 0;
@@ -204,15 +202,11 @@ static int __init mtd_readtest_init(void)
err = -ENOMEM;
iobuf = kmalloc(mtd->erasesize, GFP_KERNEL);
- if (!iobuf) {
- pr_err("error: cannot allocate memory\n");
+ if (!iobuf)
goto out;
- }
iobuf1 = kmalloc(mtd->erasesize, GFP_KERNEL);
- if (!iobuf1) {
- pr_err("error: cannot allocate memory\n");
+ if (!iobuf1)
goto out;
- }
err = scan_for_bad_eraseblocks();
if (err)
OpenPOWER on IntegriCloud