linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel/power/swap: Delete five error messages for a failed memory allocation
@ 2017-10-07 13:07 SF Markus Elfring
  0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2017-10-07 13:07 UTC (permalink / raw)
  To: linux-pm, Len Brown, Pavel Machek, Rafael J. Wysocki
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 7 Oct 2017 14:54:06 +0200

Omit extra messages 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>
---
 kernel/power/swap.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index d7cdc426ee38..ba82113c05de 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -699,7 +699,6 @@ static int save_image_lzo(struct swap_map_handle *handle,
 
 	data = vmalloc(sizeof(*data) * nr_threads);
 	if (!data) {
-		printk(KERN_ERR "PM: Failed to allocate LZO data\n");
 		ret = -ENOMEM;
 		goto out_clean;
 	}
@@ -708,7 +707,6 @@ static int save_image_lzo(struct swap_map_handle *handle,
 
 	crc = kmalloc(sizeof(*crc), GFP_KERNEL);
 	if (!crc) {
-		printk(KERN_ERR "PM: Failed to allocate crc\n");
 		ret = -ENOMEM;
 		goto out_clean;
 	}
@@ -1190,14 +1188,12 @@ static int load_image_lzo(struct swap_map_handle *handle,
 
 	page = vmalloc(sizeof(*page) * LZO_MAX_RD_PAGES);
 	if (!page) {
-		printk(KERN_ERR "PM: Failed to allocate LZO page\n");
 		ret = -ENOMEM;
 		goto out_clean;
 	}
 
 	data = vmalloc(sizeof(*data) * nr_threads);
 	if (!data) {
-		printk(KERN_ERR "PM: Failed to allocate LZO data\n");
 		ret = -ENOMEM;
 		goto out_clean;
 	}
@@ -1206,7 +1202,6 @@ static int load_image_lzo(struct swap_map_handle *handle,
 
 	crc = kmalloc(sizeof(*crc), GFP_KERNEL);
 	if (!crc) {
-		printk(KERN_ERR "PM: Failed to allocate crc\n");
 		ret = -ENOMEM;
 		goto out_clean;
 	}
-- 
2.14.2

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

only message in thread, other threads:[~2017-10-07 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-07 13:07 [PATCH] kernel/power/swap: Delete five error messages for a failed memory allocation 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;
as well as URLs for NNTP newsgroup(s).