Skip to contentSkip to conversation

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

PATCH Applied Axel Lin 2 participants 2 messages Jan 14, 2011 – Jan 18, 2011 Framebuffer layer

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 video: pxa3xx-gcu: Return -EFAULT when copy_from_user() fails

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

Also fix a typo in the comments.

---
 drivers/video/pxa3xx-gcu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/video/pxa3xx-gcu.c +2 -2
index b81168d..cf4beb9 100644
@@ -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;
Signature · 1 line
1.7.2
Applied
#1 lore raw
Quoted 6 lines · Axel Lin

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

Also fix a typo in the comments.

Applied, thanks.