Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1710757
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] kmemleak: Delete an error message for a failed memory allocation in two functions |
| Date | 2017-08-14 11:40 +0200 |
| Message-ID | <uek0O-2qo-39@gated-at.bofh.it> (permalink) |
| References | <uek0N-2qo-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 14 Aug 2017 10:50:22 +0200
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
mm/kmemleak.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 7780cd83a495..c6c798d90b2e 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -555,7 +555,6 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size,
object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp));
if (!object) {
- pr_warn("Cannot allocate a kmemleak_object structure\n");
kmemleak_disable();
return NULL;
}
@@ -775,10 +774,8 @@ static void add_scan_area(unsigned long ptr, size_t size, gfp_t gfp)
}
area = kmem_cache_alloc(scan_area_cache, gfp_kmemleak_mask(gfp));
- if (!area) {
- pr_warn("Cannot allocate a scan area\n");
+ if (!area)
goto out;
- }
spin_lock_irqsave(&object->lock, flags);
if (size == SIZE_MAX) {
--
2.14.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] kmemleak: Adjustments for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-14 11:40 +0200
[PATCH 1/2] kmemleak: Delete an error message for a failed memory allocation in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-14 11:40 +0200
Re: [PATCH 1/2] kmemleak: Delete an error message for a failed memory allocation in two functions Catalin Marinas <catalin.marinas@arm.com> - 2017-08-14 13:20 +0200
Re: [PATCH 1/2] kmemleak: Delete an error message for a failed memory allocation in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-14 13:50 +0200
Re: [PATCH 1/2] kmemleak: Delete an error message for a failed memory allocation in two functions Dan Carpenter <dan.carpenter@oracle.com> - 2017-08-14 15:10 +0200
Re: [PATCH 1/2] kmemleak: Delete an error message for a failed memory allocation in two functions Catalin Marinas <catalin.marinas@arm.com> - 2017-08-14 16:40 +0200
Re: [PATCH 1/2] kmemleak: Delete an error message for a failed memory allocation in two functions Dan Carpenter <dan.carpenter@oracle.com> - 2017-08-14 16:50 +0200
csiph-web