Skip to contentSkip to conversation

misc/lkdtm_usercopy: Delete an error message for a failed memory allocation in do_usercopy_heap_whitelist()

PATCH New SF Markus Elfring 1 participant 1 message Jan 9, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc/lkdtm_usercopy: Delete an error message for a failed memory allocation in do_usercopy_heap_whitelist()

From: Markus Elfring <[email protected]>
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.

---
 drivers/misc/lkdtm_usercopy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/misc/lkdtm_usercopy.c +1 -3
index 9725aed305bb..ed50c1db4f87 100644
@@ -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,
Signature · 1 line
2.15.1