diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-17 00:24:37 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-08 10:35:44 -0700 |
commit | 27a22f3c622a9ecd8c51a6516ecc039b714c51a1 (patch) | |
tree | d65c2871d2fd1d2f010691f49339ef082ec49c6c /drivers/media/radio | |
parent | 9c31c4ab18adde177c4f2ed9474b38bdeee187fd (diff) |
si4713-i2c: avoid potential buffer overflow on si4713
commit dc6b845044ccb7e9e6f3b7e71bd179b3cf0223b6 upstream.
While compiling it with Fedora 15, I noticed this issue:
inlined from ‘si4713_write_econtrol_string’ at drivers/media/radio/si4713-i2c.c:1065:24:
arch/x86/include/asm/uaccess_32.h:211:26: error: call to ‘copy_from_user_overflow’ declared with attribute error: copy_from_user() buffer size is not provably correct
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Eduardo Valentin <edubezval@gmail.com>
Reviewed-by: Eugene Teo <eugeneteo@kernel.sg>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r-- | drivers/media/radio/si4713-i2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/radio/si4713-i2c.c b/drivers/media/radio/si4713-i2c.c index 6a0028eb461f..93653c6e3040 100644 --- a/drivers/media/radio/si4713-i2c.c +++ b/drivers/media/radio/si4713-i2c.c @@ -1003,7 +1003,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev, char ps_name[MAX_RDS_PS_NAME + 1]; len = control->size - 1; - if (len > MAX_RDS_PS_NAME) { + if (len < 0 || len > MAX_RDS_PS_NAME) { rval = -ERANGE; goto exit; } @@ -1025,7 +1025,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev, char radio_text[MAX_RDS_RADIO_TEXT + 1]; len = control->size - 1; - if (len > MAX_RDS_RADIO_TEXT) { + if (len < 0 || len > MAX_RDS_RADIO_TEXT) { rval = -ERANGE; goto exit; } |