Commit 6d33377f authored by Laurent Caumont's avatar Laurent Caumont Committed by Mauro Carvalho Chehab

media: dvb: i2c transfers over usb cannot be done from stack

Cc: stable@vger.kernel.org
Signed-off-by: default avatarLaurent Caumont <lcaumont2@gmail.com>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent be9b53c8
...@@ -223,8 +223,20 @@ EXPORT_SYMBOL(dibusb_i2c_algo); ...@@ -223,8 +223,20 @@ EXPORT_SYMBOL(dibusb_i2c_algo);
int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val) int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val)
{ {
u8 wbuf[1] = { offs }; u8 *buf;
return dibusb_i2c_msg(d, 0x50, wbuf, 1, val, 1); 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); EXPORT_SYMBOL(dibusb_read_eeprom_byte);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment