Skip to content

Commit

Permalink
[media] touptek: don't DMA at the stack
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mauro Carvalho Chehab committed Mar 10, 2016
1 parent eef8fc3 commit ad72204
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/usb/gspca/touptek.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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");

Expand Down

0 comments on commit ad72204

Please sign in to comment.