[PATCH] video: pxa3xx-gcu: Return -EFAULT when copy_from_user() fails

Subsystems: framebuffer layer, the rest

STALE5704d

2 messages, 2 authors, 2011-01-18 · open the first message on its own page

[PATCH] video: pxa3xx-gcu: Return -EFAULT when copy_from_user() fails

From: Axel Lin <hidden>
Date: 2011-01-14 09:39:22

Return -EFAULT instead of number of bytes that could not be copied if
copy_from_user() fails.

Also fix a typo in the comments.

Signed-off-by: Axel Lin <redacted>
---
 drivers/video/pxa3xx-gcu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
index b81168d..cf4beb9 100644
--- a/drivers/video/pxa3xx-gcu.c
+++ b/drivers/video/pxa3xx-gcu.c
@@ -1,5 +1,5 @@
 /*
- *  pxa3xx-gc.c - Linux kernel module for PXA3xx graphics controllers
+ *  pxa3xx-gcu.c - Linux kernel module for PXA3xx graphics controllers
  *
  *  This driver needs a DirectFB counterpart in user space, communication
  *  is handled via mmap()ed memory areas and an ioctl.
@@ -421,7 +421,7 @@ pxa3xx_gcu_misc_write(struct file *filp, const char *buff,
 		buffer->next = priv->free;
 		priv->free = buffer;
 		spin_unlock_irqrestore(&priv->spinlock, flags);
-		return ret;
+		return -EFAULT;
 	}
 
 	buffer->length = words;
-- 
1.7.2


Re: [PATCH] video: pxa3xx-gcu: Return -EFAULT when copy_from_user() fails

From: Paul Mundt <hidden>
Date: 2011-01-18 04:41:10

On Fri, Jan 14, 2011 at 05:39:11PM +0800, Axel Lin wrote:
Return -EFAULT instead of number of bytes that could not be copied if
copy_from_user() fails.

Also fix a typo in the comments.

Signed-off-by: Axel Lin <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help