diff options
author | Brian Norris <computersforpeace@gmail.com> | 2013-05-03 01:18:51 +0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-05 23:49:22 +0400 |
commit | 33777e6676ca60652bd48c7867641fb779106909 (patch) | |
tree | 71cb59715664940f1f7ba53f4cc7463680efe405 /drivers/mtd/tests/mtd_subpagetest.c | |
parent | 59bff7fb7a0b461320744a9a9b7bf75b8eeddea8 (diff) | |
download | linux-33777e6676ca60652bd48c7867641fb779106909.tar.xz |
mtd: tests: don't print error messages when out-of-memory
These strings are now unnecessary and discouraged in the kernel. The
kernel will have plenty of big scary messages if kmalloc fails. These
now only serve to bloat the module.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/tests/mtd_subpagetest.c')
-rw-r--r-- | drivers/mtd/tests/mtd_subpagetest.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c index aade56f27945..e41a04f5caab 100644 --- a/drivers/mtd/tests/mtd_subpagetest.c +++ b/drivers/mtd/tests/mtd_subpagetest.c @@ -333,10 +333,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; - } pr_info("scanning for bad eraseblocks\n"); for (i = 0; i < ebcnt; ++i) { @@ -393,15 +391,11 @@ static int __init mtd_subpagetest_init(void) err = -ENOMEM; bufsize = subpgsize * 32; writebuf = kmalloc(bufsize, GFP_KERNEL); - if (!writebuf) { - pr_info("error: cannot allocate memory\n"); + if (!writebuf) goto out; - } readbuf = kmalloc(bufsize, GFP_KERNEL); - if (!readbuf) { - pr_info("error: cannot allocate memory\n"); + if (!readbuf) goto out; - } err = scan_for_bad_eraseblocks(); if (err) |