lkml.org 
[lkml]   [2018]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 040/254] media: dvb: i2c transfers over usb cannot be done from stack
    3.16.55-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Laurent Caumont <lcaumont2@gmail.com>

    commit 6d33377f2abbf9f0e561b116dd468d1c3ff36a6a upstream.

    Signed-off-by: Laurent Caumont <lcaumont2@gmail.com>
    Signed-off-by: Sean Young <sean@mess.org>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    drivers/media/usb/dvb-usb/dibusb-common.c | 16 ++++++++++++++--
    1 file changed, 14 insertions(+), 2 deletions(-)

    --- a/drivers/media/usb/dvb-usb/dibusb-common.c
    +++ b/drivers/media/usb/dvb-usb/dibusb-common.c
    @@ -179,8 +179,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);

    \
     
     \ /
      Last update: 2018-02-28 16:37    [W:4.147 / U:0.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site