summaryrefslogtreecommitdiff
path: root/lib/test_kasan.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-11-18 02:28:00 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-18 03:10:01 +0300
commitdc2bf000a2848cf1dee373db14ce2cd1fe3ee394 (patch)
treef3e52c19d108d51d0f8daa43a27235fce3a14ecf /lib/test_kasan.c
parentd6b28e0996962aeadd3777ae565ae03dd5c59f18 (diff)
downloadlinux-dc2bf000a2848cf1dee373db14ce2cd1fe3ee394.tar.xz
lib/test: delete five error messages for failed memory allocations
Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Link: http://lkml.kernel.org/r/410a4c5a-4ee0-6fcc-969c-103d8e496b78@users.sourceforge.net Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/test_kasan.c')
-rw-r--r--lib/test_kasan.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/test_kasan.c b/lib/test_kasan.c
index a25c9763fce1..ef1a3ac1397e 100644
--- a/lib/test_kasan.c
+++ b/lib/test_kasan.c
@@ -353,10 +353,9 @@ static noinline void __init memcg_accounted_kmem_cache(void)
*/
for (i = 0; i < 5; i++) {
p = kmem_cache_alloc(cache, GFP_KERNEL);
- if (!p) {
- pr_err("Allocation failed\n");
+ if (!p)
goto free_cache;
- }
+
kmem_cache_free(cache, p);
msleep(100);
}