All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: dougg@torque.net, linux-scsi@vger.kernel.org
Subject: [PATCH] fix sg leak when scsi_execute_async fails
Date: Wed, 22 Mar 2006 16:04:38 -0600	[thread overview]
Message-ID: <1143065078.2650.3.camel@max> (raw)

Doug found a bug where if scsi_execute_async fails, we are leaking
sg resources. scsi_do_req never failed so we did not have to handle
that case before.

Patch was made against scsi-misc. Not sure if this should
also go to stable?

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>



diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index a8b05ce..71994ea 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -748,6 +748,7 @@ sg_common_write(Sg_fd * sfp, Sg_request 
 		/*
 		 * most likely out of mem, but could also be a bad map
 		 */
+		sg_finish_rem_req(srp);
 		return -ENOMEM;
 	} else
 		return 0;



             reply	other threads:[~2006-03-22 22:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-22 22:04 Mike Christie [this message]
2006-03-22 23:10 ` [PATCH] fix sg leak when scsi_execute_async fails Douglas Gilbert

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=1143065078.2650.3.camel@max \
    --to=michaelc@cs.wisc.edu \
    --cc=dougg@torque.net \
    --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.