diff options
Diffstat (limited to 'drivers/media/radio/si4713-i2c.c')
-rw-r--r-- | drivers/media/radio/si4713-i2c.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/radio/si4713-i2c.c b/drivers/media/radio/si4713-i2c.c index 6a0028eb461..fc7f4b79464 100644 --- a/drivers/media/radio/si4713-i2c.c +++ b/drivers/media/radio/si4713-i2c.c @@ -26,6 +26,7 @@ #include <linux/delay.h> #include <linux/interrupt.h> #include <linux/i2c.h> +#include <linux/slab.h> #include <media/v4l2-device.h> #include <media/v4l2-ioctl.h> #include <media/v4l2-common.h> @@ -1008,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) { @@ -1030,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) { @@ -1366,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: @@ -1376,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: |