diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-07 06:40:24 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-14 12:37:47 -0300 |
commit | bd1f976cc95b0689f889c8d93434ee61dd09b08b (patch) | |
tree | d1e637e65c285746c720b35fe7cc6fc61a01b695 /drivers/media/usb/dvb-usb/dib0700_core.c | |
parent | [media] cxusb: don't do DMA on stack (diff) | |
download | linux-dev-bd1f976cc95b0689f889c8d93434ee61dd09b08b.tar.xz linux-dev-bd1f976cc95b0689f889c8d93434ee61dd09b08b.zip |
[media] dib0700: be sure that dib0700_ctrl_rd() users can do DMA
dib0700_ctrl_rd() takes a RX and a TX pointer. Be sure that
both will point to a memory allocated via kmalloc().
Reviewed-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/media/usb/dvb-usb/dib0700_core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c index f3196658fb70..515f89dba199 100644 --- a/drivers/media/usb/dvb-usb/dib0700_core.c +++ b/drivers/media/usb/dvb-usb/dib0700_core.c @@ -292,13 +292,15 @@ static int dib0700_i2c_xfer_legacy(struct i2c_adapter *adap, /* special thing in the current firmware: when length is zero the read-failed */ len = dib0700_ctrl_rd(d, st->buf, msg[i].len + 2, - msg[i+1].buf, msg[i+1].len); + st->buf, msg[i + 1].len); if (len <= 0) { deb_info("I2C read failed on address 0x%02x\n", msg[i].addr); break; } + memcpy(msg[i + 1].buf, st->buf, msg[i + 1].len); + msg[i+1].len = len; i++; |