All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Northup <digitaleric@google.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org
Subject: Re: [PATCH] virtio_scsi: fix memory leak on full queue condition.
Date: Fri, 09 Nov 2012 09:48:02 +0100	[thread overview]
Message-ID: <509CC342.80700@redhat.com> (raw)
In-Reply-To: <1352368550-6694-1-git-send-email-digitaleric@google.com>

Il 08/11/2012 10:55, Eric Northup ha scritto:
> virtscsi_queuecommand was leaking memory when the virtio queue was full.
> 
> Tested: Guest operates correctly even with very small queue sizes, validated
> we're not leaking kmalloc-192 sized allocations anymore.
> 
> Signed-off-by: Eric Northup <digitaleric@google.com>
> ---
>  drivers/scsi/virtio_scsi.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
> index 595af1a..dd8dc27 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -469,6 +469,8 @@ static int virtscsi_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)
>  			      sizeof cmd->req.cmd, sizeof cmd->resp.cmd,
>  			      GFP_ATOMIC) >= 0)
>  		ret = 0;
> +	else
> +		mempool_free(cmd, virtscsi_cmd_pool);
>  
>  out:
>  	return ret;
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

      reply	other threads:[~2012-11-09  8:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-08  9:55 [PATCH] virtio_scsi: fix memory leak on full queue condition Eric Northup
2012-11-09  8:48 ` Paolo Bonzini [this message]

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=509CC342.80700@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=JBottomley@parallels.com \
    --cc=digitaleric@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.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.