diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-07-03 10:09:12 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:16:41 -0400 |
commit | bf7f0b98426b54c29ec8100a3f1963114c2f2ef0 (patch) | |
tree | c3d43d2240020fded85674066fd2cb7a5a503f86 /drivers/media/video/gspca/sonixj.c | |
parent | 0d2a722ddae5e736a5c36a1b99ee4ca59a8373bc (diff) |
V4L/DVB (8193): gspca: Input buffer may be changed on reg write.
Done for conex, etoms, pac7311, sonixj, t613 and tv8532.
Code cleanup for some other subdrivers.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/gspca/sonixj.c')
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index e6a49fe2c4e3..4f23b16c89a8 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -24,8 +24,8 @@ | |||
24 | #include "gspca.h" | 24 | #include "gspca.h" |
25 | #include "jpeg.h" | 25 | #include "jpeg.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 3) |
28 | static const char version[] = "2.1.0"; | 28 | static const char version[] = "2.1.3"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); | 30 | MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); |
31 | MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver"); | 31 | MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver"); |
@@ -515,15 +515,24 @@ static void reg_r(struct usb_device *dev, | |||
515 | 515 | ||
516 | static void reg_w(struct usb_device *dev, | 516 | static void reg_w(struct usb_device *dev, |
517 | __u16 value, | 517 | __u16 value, |
518 | __u8 *buffer, | 518 | const __u8 *buffer, |
519 | int len) | 519 | int len) |
520 | { | 520 | { |
521 | __u8 tmpbuf[64]; | ||
522 | |||
523 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
524 | if (len > sizeof tmpbuf) { | ||
525 | PDEBUG(D_ERR|D_PACK, "reg_w: buffer overflow"); | ||
526 | return; | ||
527 | } | ||
528 | #endif | ||
529 | memcpy(tmpbuf, buffer, len); | ||
521 | usb_control_msg(dev, | 530 | usb_control_msg(dev, |
522 | usb_sndctrlpipe(dev, 0), | 531 | usb_sndctrlpipe(dev, 0), |
523 | 0x08, | 532 | 0x08, |
524 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | 533 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, |
525 | value, 0, | 534 | value, 0, |
526 | buffer, len, | 535 | tmpbuf, len, |
527 | 500); | 536 | 500); |
528 | } | 537 | } |
529 | 538 | ||