Displaying 19 results from an estimated 19 matches for "virtio_i2c_xfer".
2020 Sep 14
2
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...: hppa-linux-gcc (GCC) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp at intel.com>
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
>
> smatch warnings:
> drivers/i2c/busses/i2c-virtio.c:160 virtio_i2c_xfer() error: we previously assumed 'vmsg' could be null (see line 137)
>
It's quite possible a false positive. Look at 122. But I agree that for-loop is
not the best for such things to understand. Perhaps switching to do {} while ()
will make it better.
> # https://github.com/0day-...
2020 Sep 14
2
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...: hppa-linux-gcc (GCC) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp at intel.com>
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
>
> smatch warnings:
> drivers/i2c/busses/i2c-virtio.c:160 virtio_i2c_xfer() error: we previously assumed 'vmsg' could be null (see line 137)
>
It's quite possible a false positive. Look at 122. But I agree that for-loop is
not the best for such things to understand. Perhaps switching to do {} while ()
will make it better.
> # https://github.com/0day-...
2020 Sep 11
6
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...gt;len);
+ sg_init_one(&bout, vmsg->buf, msg->len);
+ sgs[outcnt++] = &bout;
+ }
+ sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
+ sgs[outcnt + incnt++] = &status;
+
+ return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
+}
+
+static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+ struct virtio_i2c *vi = i2c_get_adapdata(adap);
+ struct virtqueue *vq = vi->vq;
+ struct virtio_i2c_msg *vmsg;
+ unsigned long time_left;
+ int len, i, ret = 0;
+
+ mutex_lock(&vi->i2c_lock);
+ vmsg = &vi->vmsg;
+ vmsg-...
2020 Sep 11
6
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...gt;len);
+ sg_init_one(&bout, vmsg->buf, msg->len);
+ sgs[outcnt++] = &bout;
+ }
+ sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
+ sgs[outcnt + incnt++] = &status;
+
+ return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
+}
+
+static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+ struct virtio_i2c *vi = i2c_get_adapdata(adap);
+ struct virtqueue *vq = vi->vq;
+ struct virtio_i2c_msg *vmsg;
+ unsigned long time_left;
+ int len, i, ret = 0;
+
+ mutex_lock(&vi->i2c_lock);
+ vmsg = &vi->vmsg;
+ vmsg-...
2020 Sep 03
9
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...gt;len);
+ sg_init_one(&bout, vmsg->buf, msg->len);
+ sgs[outcnt++] = &bout;
+ }
+ sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
+ sgs[outcnt + incnt++] = &status;
+
+ return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
+}
+
+static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+ struct virtio_i2c *vi = i2c_get_adapdata(adap);
+ struct virtio_i2c_msg *vmsg_o, *vmsg_i;
+ struct virtqueue *vq = vi->vq;
+ unsigned long time_left;
+ int len, i, ret = 0;
+
+ vmsg_o = kzalloc(sizeof(*vmsg_o), GFP_KERNEL);
+ if (!vms...
2020 Sep 03
9
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...gt;len);
+ sg_init_one(&bout, vmsg->buf, msg->len);
+ sgs[outcnt++] = &bout;
+ }
+ sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
+ sgs[outcnt + incnt++] = &status;
+
+ return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
+}
+
+static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+ struct virtio_i2c *vi = i2c_get_adapdata(adap);
+ struct virtio_i2c_msg *vmsg_o, *vmsg_i;
+ struct virtqueue *vq = vi->vq;
+ unsigned long time_left;
+ int len, i, ret = 0;
+
+ vmsg_o = kzalloc(sizeof(*vmsg_o), GFP_KERNEL);
+ if (!vms...
2020 Sep 14
0
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...0913 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
smatch warnings:
drivers/i2c/busses/i2c-virtio.c:160 virtio_i2c_xfer() error: we previously assumed 'vmsg' could be null (see line 137)
# https://github.com/0day-ci/linux/commit/0a54ec771966748fcbc86256b830b5f786168b7d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jie-Deng/i2c-virtio-add-a-virtio-i2c-frontend-...
2020 Sep 14
0
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...gt;
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp at intel.com>
> > Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
> >
> > smatch warnings:
> > drivers/i2c/busses/i2c-virtio.c:160 virtio_i2c_xfer() error: we previously assumed 'vmsg' could be null (see line 137)
> >
>
> It's quite possible a false positive. Look at 122. But I agree that for-loop is
> not the best for such things to understand. Perhaps switching to do {} while ()
> will make it better.
>...
2020 Sep 22
3
[PATCH v3] i2c: virtio: add a virtio i2c frontend driver
...gt;len);
+ sg_init_one(&bout, vmsg->buf, msg->len);
+ sgs[outcnt++] = &bout;
+ }
+ sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
+ sgs[outcnt + incnt++] = &status;
+
+ return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
+}
+
+static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+ struct virtio_i2c *vi = i2c_get_adapdata(adap);
+ struct virtqueue *vq = vi->vq;
+ struct virtio_i2c_msg *vmsg;
+ unsigned long time_left;
+ int len, i, ret = 0;
+
+ mutex_lock(&vi->i2c_lock);
+ vmsg = &vi->vmsg;
+ vmsg-...
2020 Sep 22
3
[PATCH v3] i2c: virtio: add a virtio i2c frontend driver
...gt;len);
+ sg_init_one(&bout, vmsg->buf, msg->len);
+ sgs[outcnt++] = &bout;
+ }
+ sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
+ sgs[outcnt + incnt++] = &status;
+
+ return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
+}
+
+static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+ struct virtio_i2c *vi = i2c_get_adapdata(adap);
+ struct virtqueue *vq = vi->vq;
+ struct virtio_i2c_msg *vmsg;
+ unsigned long time_left;
+ int len, i, ret = 0;
+
+ mutex_lock(&vi->i2c_lock);
+ vmsg = &vi->vmsg;
+ vmsg-...
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...uf, msg->len);
> + sgs[outcnt++] = &bout;
> + }
> + sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
> + sgs[outcnt + incnt++] = &status;
> +
> + return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
> +}
> +
> +static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
> +{
> + struct virtio_i2c *vi = i2c_get_adapdata(adap);
> + struct virtio_i2c_msg *vmsg_o, *vmsg_i;
> + struct virtqueue *vq = vi->vq;
> + unsigned long time_left;
> + int len, i, ret = 0;
> +
> + vmsg_o = kzalloc(...
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...uf, msg->len);
> + sgs[outcnt++] = &bout;
> + }
> + sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
> + sgs[outcnt + incnt++] = &status;
> +
> + return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
> +}
> +
> +static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
> +{
> + struct virtio_i2c *vi = i2c_get_adapdata(adap);
> + struct virtio_i2c_msg *vmsg_o, *vmsg_i;
> + struct virtqueue *vq = vi->vq;
> + unsigned long time_left;
> + int len, i, ret = 0;
> +
> + vmsg_o = kzalloc(...
2020 Sep 14
0
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...uf, msg->len);
> + sgs[outcnt++] = &bout;
> + }
> + sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
> + sgs[outcnt + incnt++] = &status;
> +
> + return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
> +}
> +
> +static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
> +{
> + struct virtio_i2c *vi = i2c_get_adapdata(adap);
> + struct virtqueue *vq = vi->vq;
> + struct virtio_i2c_msg *vmsg;
> + unsigned long time_left;
> + int len, i, ret = 0;
> +
> + mutex_lock(&vi->i2c_l...
2020 Sep 04
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...uf, msg->len);
> + sgs[outcnt++] = &bout;
> + }
> + sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
> + sgs[outcnt + incnt++] = &status;
> +
> + return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
> +}
> +
> +static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
> +{
> + struct virtio_i2c *vi = i2c_get_adapdata(adap);
> + struct virtio_i2c_msg *vmsg_o, *vmsg_i;
> + struct virtqueue *vq = vi->vq;
> + unsigned long time_left;
> + int len, i, ret = 0;
> +
> + vmsg_o = kzalloc(...
2020 Sep 04
2
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...mp;bout;
>> +??? }
>> +??? sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
>> +??? sgs[outcnt + incnt++] = &status;
>> +
>> +??? return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
>> +}
>> +
>> +static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg
>> *msgs, int num)
>> +{
>> +??? struct virtio_i2c *vi = i2c_get_adapdata(adap);
>> +??? struct virtio_i2c_msg *vmsg_o, *vmsg_i;
>> +??? struct virtqueue *vq = vi->vq;
>> +??? unsigned long time_left;
>> +??? int...
2020 Sep 04
2
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...mp;bout;
>> +??? }
>> +??? sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
>> +??? sgs[outcnt + incnt++] = &status;
>> +
>> +??? return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
>> +}
>> +
>> +static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg
>> *msgs, int num)
>> +{
>> +??? struct virtio_i2c *vi = i2c_get_adapdata(adap);
>> +??? struct virtio_i2c_msg *vmsg_o, *vmsg_i;
>> +??? struct virtqueue *vq = vi->vq;
>> +??? unsigned long time_left;
>> +??? int...
2020 Sep 22
0
[PATCH v3] i2c: virtio: add a virtio i2c frontend driver
...uf, msg->len);
> + sgs[outcnt++] = &bout;
> + }
> + sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
> + sgs[outcnt + incnt++] = &status;
> +
> + return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg, GFP_KERNEL);
> +}
> +
> +static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
> +{
> + struct virtio_i2c *vi = i2c_get_adapdata(adap);
> + struct virtqueue *vq = vi->vq;
> + struct virtio_i2c_msg *vmsg;
> + unsigned long time_left;
> + int len, i, ret = 0;
> +
> + mutex_lock(&vi->i2c_l...
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...+ * @flags: i2c_msg flags
> + * @len: i2c_msg len
> + */
> +struct virtio_i2c_hdr {
> + __virtio16 addr;
> + __virtio16 flags;
> + __virtio16 len;
> +} __packed;
As Misha noticed and somewhere I saw 0-day reports these should be carefully
taken care of.
...
> +static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
> +{
> + struct virtio_i2c *vi = i2c_get_adapdata(adap);
> + struct virtio_i2c_msg *vmsg_o, *vmsg_i;
> + struct virtqueue *vq = vi->vq;
> + unsigned long time_left;
> + int len, i, ret = 0;
> +
> + vmsg_o = kzalloc(...
2020 Sep 07
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...sg_init_one(&status, &vmsg->status, sizeof(vmsg->status));
>>> +??? sgs[outcnt + incnt++] = &status;
>>> +
>>> +??? return virtqueue_add_sgs(vq, sgs, outcnt, incnt, vmsg,
>>> GFP_KERNEL);
>>> +}
>>> +
>>> +static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg
>>> *msgs, int num)
>>> +{
>>> +??? struct virtio_i2c *vi = i2c_get_adapdata(adap);
>>> +??? struct virtio_i2c_msg *vmsg_o, *vmsg_i;
>>> +??? struct virtqueue *vq = vi->vq;
>>> +??? unsigned long time...