All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: Ingo Oeser <ioe-lkml@rameria.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, Avi Kivity <avi@redhat.com>
Subject: Re: [PATCH 2/3] virtio: indirect ring entries (VIRTIO_RING_F_INDIRECT_DESC)
Date: Mon, 22 Dec 2008 10:17:21 +0000	[thread overview]
Message-ID: <1229941041.19474.2.camel@localhost.localdomain> (raw)
In-Reply-To: <200812201238.07510.ioe-lkml@rameria.de>

Hi Ingo,

On Sat, 2008-12-20 at 12:38 +0100, Ingo Oeser wrote:
> Hi Mark,
> 
> On Thursday 18 December 2008, Mark McLoughlin wrote:
> > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> > index 5777196..2330c4b 100644
> > --- a/drivers/virtio/virtio_ring.c
> > +++ b/drivers/virtio/virtio_ring.c
> > @@ -70,6 +73,55 @@ struct vring_virtqueue
> >  
> >  #define to_vvq(_vq) container_of(_vq, struct vring_virtqueue, vq)
> >  
> > +/* Set up an indirect table of descriptors and add it to the queue. */
> > +static int vring_add_indirect(struct vring_virtqueue *vq,
> > +			      struct scatterlist sg[],
> > +			      unsigned int out,
> > +			      unsigned int in)
> > +{
> > +	struct vring_desc *desc;
> > +	unsigned head;
> > +	int i;
> > +
> > +	desc = kmalloc((out + in) * sizeof(struct vring_desc), GFP_ATOMIC);
> 
> kmalloc() returns ZERO_SIZE_PTR, if (out + in) == 0

vring_add_buf() has:

  BUG_ON(out + in == 0)

I should just add that here too before the kmalloc() call.

Thanks,
Mark.


  reply	other threads:[~2008-12-22 10:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-18 17:10 [PATCH 0/3] virtio: indirect ring entries Mark McLoughlin
2008-12-18 17:10 ` [PATCH 1/3] virtio: teach virtio_has_feature() about transport features Mark McLoughlin
2008-12-18 17:10   ` [PATCH 2/3] virtio: indirect ring entries (VIRTIO_RING_F_INDIRECT_DESC) Mark McLoughlin
2008-12-18 17:10     ` [PATCH 3/3] lguest: add support for indirect ring entries Mark McLoughlin
2008-12-20 11:38     ` [PATCH 2/3] virtio: indirect ring entries (VIRTIO_RING_F_INDIRECT_DESC) Ingo Oeser
2008-12-20 11:38     ` Ingo Oeser
2008-12-22 10:17       ` Mark McLoughlin [this message]
2008-12-22 10:17       ` Mark McLoughlin
2009-04-21 12:59     ` Mark McLoughlin
2009-04-27  7:43       ` Dor Laor
2009-05-04  2:19         ` Rusty Russell
2009-05-11 17:10           ` Mark McLoughlin
2009-05-11 17:10           ` Mark McLoughlin
2009-05-11 17:11             ` [PATCH 1/3] virtio: teach virtio_has_feature() about transport features Mark McLoughlin
2009-05-11 17:11               ` [PATCH 2/3] virtio: indirect ring entries (VIRTIO_RING_F_INDIRECT_DESC) Mark McLoughlin
2009-05-11 17:11                 ` [PATCH 3/3] lguest: add support for indirect ring entries Mark McLoughlin
2009-05-12 14:23             ` [PATCH 2/3] virtio: indirect ring entries (VIRTIO_RING_F_INDIRECT_DESC) Rusty Russell
2009-05-12 14:23             ` Rusty Russell
2009-05-17  2:04             ` Rusty Russell
2009-05-17  6:27               ` Avi Kivity
2009-05-17 14:16                 ` Rusty Russell
2009-05-17 15:05                   ` Avi Kivity
2009-05-17 15:05                   ` Avi Kivity
2009-05-19  8:15                     ` Rusty Russell
2009-05-19  8:15                     ` Rusty Russell
2009-05-17 14:16                 ` Rusty Russell
2009-05-17  6:27               ` Avi Kivity
2009-05-17  2:04             ` Rusty Russell
2009-04-21 12:59     ` Mark McLoughlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229941041.19474.2.camel@localhost.localdomain \
    --to=markmc@redhat.com \
    --cc=avi@redhat.com \
    --cc=ioe-lkml@rameria.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.