This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-dvb.git tree:

Subject: V4L/DVB: dvb_ca_en50221: return -EFAULT on copy_to_user errors
Author:  Dan Carpenter <[email protected]>
Date:    Fri Jun 4 12:39:03 2010 -0300

copy_to_user() returns the number of bytes remaining to be copied which
isn't the right thing to return here.  The comments say that these
functions in dvb_ca_en50221.c should return the number of bytes copied or
an error return.  I've changed it to return -EFAULT.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/dvb/dvb-core/dvb_ca_en50221.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

---

http://git.linuxtv.org/v4l-dvb.git?a=commitdiff;h=8c2cfad8191f35bf33b18cced768711bffabeae2

diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 
b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index ef259a0..cb97e6b 100644
--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@ -1318,8 +1318,11 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
 
                fragbuf[0] = connection_id;
                fragbuf[1] = ((fragpos + fraglen) < count) ? 0x80 : 0x00;
-               if ((status = copy_from_user(fragbuf + 2, buf + fragpos, 
fraglen)) != 0)
+               status = copy_from_user(fragbuf + 2, buf + fragpos, fraglen);
+               if (status) {
+                       status = -EFAULT;
                        goto exit;
+               }
 
                timeout = jiffies + HZ / 2;
                written = 0;
@@ -1494,8 +1497,11 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, 
char __user * buf,
 
        hdr[0] = slot;
        hdr[1] = connection_id;
-       if ((status = copy_to_user(buf, hdr, 2)) != 0)
+       status = copy_to_user(buf, hdr, 2);
+       if (status) {
+               status = -EFAULT;
                goto exit;
+       }
        status = pktlen;
 
 exit:

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to