From: axel lin Date: Fri, 14 Jan 2011 09:39:11 +0000 (+0000) Subject: video: pxa3xx-gcu: Return -EFAULT when copy_from_user() fails X-Git-Tag: upstream/snapshot3+hdmi~11610^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b7f1cc79d61427961e311c6a21f528bdb226e40;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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. Signed-off-by: Axel Lin Signed-off-by: Paul Mundt --- 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;