Skip to content

Commit

Permalink
media: dvb: i2c transfers over usb cannot be done from stack
Browse files Browse the repository at this point in the history
Cc: [email protected]
Signed-off-by: Laurent Caumont <[email protected]>
Signed-off-by: Sean Young <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Laurent Caumont authored and mchehab committed Nov 30, 2017
1 parent be9b53c commit 6d33377
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions drivers/media/usb/dvb-usb/dibusb-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,20 @@ EXPORT_SYMBOL(dibusb_i2c_algo);

int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val)
{
u8 wbuf[1] = { offs };
return dibusb_i2c_msg(d, 0x50, wbuf, 1, val, 1);
u8 *buf;
int rc;

buf = kmalloc(2, GFP_KERNEL);
if (!buf)
return -ENOMEM;

buf[0] = offs;

rc = dibusb_i2c_msg(d, 0x50, &buf[0], 1, &buf[1], 1);
*val = buf[1];
kfree(buf);

return rc;
}
EXPORT_SYMBOL(dibusb_read_eeprom_byte);

Expand Down

0 comments on commit 6d33377

Please sign in to comment.