Ignore:
Timestamp:
Apr 21, 2017, 4:28:29 AM (5 weeks ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/drivers/media/usb/dvb-usb/cxusb.c

    r31574 r31885  
    6060{
    6161        struct cxusb_state *st = d->priv;
    62         int ret, wo;
     62        int ret;
    6363
    6464        if (1 + wlen > MAX_XFER_SIZE) {
     
    6767        }
    6868
    69         wo = (rbuf == NULL || rlen == 0); /* write-only */
     69        if (rlen > MAX_XFER_SIZE) {
     70                warn("i2c rd: len=%d is too big!\n", rlen);
     71                return -EOPNOTSUPP;
     72        }
    7073
    7174        mutex_lock(&d->data_mutex);
    7275        st->data[0] = cmd;
    7376        memcpy(&st->data[1], wbuf, wlen);
    74         if (wo)
    75                 ret = dvb_usb_generic_write(d, st->data, 1 + wlen);
    76         else
    77                 ret = dvb_usb_generic_rw(d, st->data, 1 + wlen,
    78                                          rbuf, rlen, 0);
     77        ret = dvb_usb_generic_rw(d, st->data, 1 + wlen, st->data, rlen, 0);
     78        if (!ret && rbuf && rlen)
     79                memcpy(rbuf, st->data, rlen);
    7980
    8081        mutex_unlock(&d->data_mutex);
Note: See TracChangeset for help on using the changeset viewer.