summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-06 16:12:32 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-10 19:37:45 +0300
commitad7220479244e92d7eba2ecc4b3f3e08312fc68f (patch)
treedd25992644f04efdb8ef5ed2c6b80bc15a0ff8d8 /drivers/media
parenteef8fc374c131647ea9eea3301f06f4eee7f51ae (diff)
downloadlinux-ad7220479244e92d7eba2ecc4b3f3e08312fc68f.tar.xz
[media] touptek: don't DMA at the stack
As warned by smatch: drivers/media/usb/gspca/touptek.c:220 reg_w() error: doing dma on the stack (buff) drivers/media/usb/gspca/touptek.c:458 configure() error: doing dma on the stack (buff) This can fail, as the stack may not be in a memory that would allod DMA. So, use the usb_buf instead. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/gspca/touptek.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/usb/gspca/touptek.c b/drivers/media/usb/gspca/touptek.c
index 7bac6bc96063..8063b8e45ee5 100644
--- a/drivers/media/usb/gspca/touptek.c
+++ b/drivers/media/usb/gspca/touptek.c
@@ -211,7 +211,7 @@ static int val_reply(struct gspca_dev *gspca_dev, const char *reply, int rc)
static void reg_w(struct gspca_dev *gspca_dev, u16 value, u16 index)
{
- char buff[1];
+ char *buff = gspca_dev->usb_buf;
int rc;
PDEBUG(D_USBO,
@@ -438,7 +438,7 @@ static void configure_encrypted(struct gspca_dev *gspca_dev)
static int configure(struct gspca_dev *gspca_dev)
{
int rc;
- uint8_t buff[4];
+ char *buff = gspca_dev->usb_buf;
PDEBUG(D_STREAM, "configure()\n");