search for: vmsg_o

Displaying 9 results from an estimated 9 matches for "vmsg_o".

Did you mean: vmsg_i
2020 Sep 03
9
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...f(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 (!vmsg_o) + return -ENOMEM; + + mutex_lock(&vi->i2c_lock); + vmsg_o->buf = NULL; + for (i = 0; i < num; i++) { + ret = virtio_i2c_ad...
2020 Sep 03
9
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...f(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 (!vmsg_o) + return -ENOMEM; + + mutex_lock(&vi->i2c_lock); + vmsg_o->buf = NULL; + for (i = 0; i < num; i++) { + ret = virtio_i2c_ad...
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...> +} __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(sizeof(*vmsg_o), GFP_KERNEL); > + if (!vmsg_o) > + return -ENOMEM; > + > + mutex_lock(&vi->i2c_lock); > + vmsg_o->buf = NULL; >...
2020 Sep 04
2
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...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 (!vmsg_o) >> +??????? return -ENOMEM; > > > It looks to me we c...
2020 Sep 04
2
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...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 (!vmsg_o) >> +??????? return -ENOMEM; > > > It looks to me we c...
2020 Sep 07
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...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 (!vmsg_o) >>> +??????? return -ENOMEM; >&g...
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...t++] = &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 (!vmsg_o) > + return -ENOMEM; > + > + mutex_lock(&vi->i2c_lock); > + vmsg_o->buf = NULL; >...
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...t++] = &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 (!vmsg_o) > + return -ENOMEM; > + > + mutex_lock(&vi->i2c_lock); > + vmsg_o->buf = NULL; >...
2020 Sep 04
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...t++] = &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 (!vmsg_o) > + return -ENOMEM; It looks to me we can avoid the allocation by embedding virtio_i2c_msg into stru...