mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] misc/lkdtm_usercopy: Delete an error message for a failed memory allocation in do_usercopy_heap_whitelist()
@ 2018-01-09 12:42 SF Markus Elfring
  0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2018-01-09 12:42 UTC (permalink / raw)
  To: kernel-janitors, Arnd Bergmann, Greg Kroah-Hartman, Kees Cook; +Cc: LKML

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 9 Jan 2018 13:31:43 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/misc/lkdtm_usercopy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/misc/lkdtm_usercopy.c b/drivers/misc/lkdtm_usercopy.c
index 9725aed305bb..ed50c1db4f87 100644
--- a/drivers/misc/lkdtm_usercopy.c
+++ b/drivers/misc/lkdtm_usercopy.c
@@ -202,10 +202,8 @@ static void do_usercopy_heap_whitelist(bool to_user)
 	 * Allocate a buffer with a whitelisted window in the buffer.
 	 */
 	buf = kmem_cache_alloc(whitelist_cache, GFP_KERNEL);
-	if (!buf) {
-		pr_warn("Failed to allocate buffer from whitelist cache\n");
+	if (!buf)
 		goto free_alloc;
-	}
 
 	/* Allocate user memory we'll poke at. */
 	user_alloc = vm_mmap(NULL, 0, PAGE_SIZE,
-- 
2.15.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-09 12:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09 12:42 [PATCH] misc/lkdtm_usercopy: Delete an error message for a failed memory allocation in do_usercopy_heap_whitelist() SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®