Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1646194

[PATCH 5/5] fsl_hypervisor: Delete error messages for failed memory allocations in ioctl_memcpy()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 5/5] fsl_hypervisor: Delete error messages for failed memory allocations in ioctl_memcpy()
Date 2017-05-20 21:20 +0200
Message-ID <tJi4V-5vp-7@gated-at.bofh.it> (permalink)
References <tJhVf-5rT-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 20 May 2017 20:27:23 +0200

Omit two extra messages for memory allocation failures in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/virt/fsl_hypervisor.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c
index 4031632b8c9d..db07c76f1ff7 100644
--- a/drivers/virt/fsl_hypervisor.c
+++ b/drivers/virt/fsl_hypervisor.c
@@ -227,7 +227,5 @@ static long ioctl_memcpy(struct fsl_hv_ioctl_memcpy __user *p)
-	if (!pages) {
-		pr_debug("fsl-hv: could not allocate page list\n");
+	if (!pages)
 		return -ENOMEM;
-	}
 
 	/*
 	 * sg_list is the list of fh_sg_list objects that we pass to the
@@ -238,5 +236,4 @@ static long ioctl_memcpy(struct fsl_hv_ioctl_memcpy __user *p)
 	if (!sg_list_unaligned) {
-		pr_debug("fsl-hv: could not allocate S/G list\n");
 		ret = -ENOMEM;
 		goto exit;
 	}
-- 
2.13.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] fsl_hypervisor: Adjustments for two function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 21:10 +0200
  [PATCH 3/5] fsl_hypervisor: Return the success indication only as a  constant in fsl_hv_open() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 21:20 +0200
  [PATCH 5/5] fsl_hypervisor: Delete error messages for failed memory  allocations in ioctl_memcpy() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 21:20 +0200
  [PATCH 4/5] fsl_hypervisor: Use kcalloc() in ioctl_memcpy() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 21:20 +0200
  [PATCH 1/5] fsl_hypervisor: Improve a size determination in  fsl_hv_open() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 21:20 +0200
  [PATCH 2/5] fsl_hypervisor: Delete an error message for a failed  memory allocation in fsl_hv_open() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 21:20 +0200

csiph-web