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: media/radio: fix copy_to_user to user handling
Author:  Dan Carpenter <[email protected]>
Date:    Fri Jun 4 07:34:40 2010 -0300

copy_to/from_user() returns the number of bytes remaining to be copied
but the code here was testing for negative returns.  I modified it to
return -EFAULT.  These functions are called from si4713_s_ext_ctrls() and
that only tests for negative error codes.

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

 drivers/media/radio/si4713-i2c.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

---

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

diff --git a/drivers/media/radio/si4713-i2c.c b/drivers/media/radio/si4713-i2c.c
index ab63dd5..fc7f4b7 100644
--- a/drivers/media/radio/si4713-i2c.c
+++ b/drivers/media/radio/si4713-i2c.c
@@ -1009,8 +1009,10 @@ static int si4713_write_econtrol_string(struct 
si4713_device *sdev,
                        goto exit;
                }
                rval = copy_from_user(ps_name, control->string, len);
-               if (rval < 0)
+               if (rval) {
+                       rval = -EFAULT;
                        goto exit;
+               }
                ps_name[len] = '\0';
 
                if (strlen(ps_name) % vqc.step) {
@@ -1031,8 +1033,10 @@ static int si4713_write_econtrol_string(struct 
si4713_device *sdev,
                        goto exit;
                }
                rval = copy_from_user(radio_text, control->string, len);
-               if (rval < 0)
+               if (rval) {
+                       rval = -EFAULT;
                        goto exit;
+               }
                radio_text[len] = '\0';
 
                if (strlen(radio_text) % vqc.step) {
@@ -1367,6 +1371,8 @@ static int si4713_read_econtrol_string(struct 
si4713_device *sdev,
                }
                rval = copy_to_user(control->string, sdev->rds_info.ps_name,
                                        strlen(sdev->rds_info.ps_name) + 1);
+               if (rval)
+                       rval = -EFAULT;
                break;
 
        case V4L2_CID_RDS_TX_RADIO_TEXT:
@@ -1377,6 +1383,8 @@ static int si4713_read_econtrol_string(struct 
si4713_device *sdev,
                }
                rval = copy_to_user(control->string, sdev->rds_info.radio_text,
                                        strlen(sdev->rds_info.radio_text) + 1);
+               if (rval)
+                       rval = -EFAULT;
                break;
 
        default:

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

Reply via email to