All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: linux-scsi@vger.kernel.org
Cc: Bob Tracy <rct@gherkin.frus.com>,
	linux-kernel@vger.kernel.org, stable@kernel.org
Subject: [PATCH] sg: fix oops in the error path in sg_build_indirect()
Date: Thu, 3 Sep 2009 14:27:08 +0200	[thread overview]
Message-ID: <20090903142708.0b820ca1@leela> (raw)
In-Reply-To: <20090903033945.GA20755@gherkin.frus.com>

When the allocation fails in sg_build_indirect(), an oops happens in
the error path. It's caused by an obvious typo.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reported-by: Bob Tracy <rct@gherkin.frus.com>
---

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 9230402..4968c4c 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1811,7 +1811,7 @@ retry:
 	return 0;
 out:
 	for (i = 0; i < k; i++)
-		__free_pages(schp->pages[k], order);
+		__free_pages(schp->pages[i], order);
 
 	if (--order >= 0)
 		goto retry;

  reply	other threads:[~2009-09-03 12:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03  3:39 [BUG] 2.6.31-rc8 readcd Oops Bob Tracy
2009-09-03 12:27 ` Michal Schmidt [this message]
2009-09-03 13:54   ` [PATCH] sg: fix oops in the error path in sg_build_indirect() Douglas Gilbert
2009-09-03 14:41   ` Bob Tracy

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=20090903142708.0b820ca1@leela \
    --to=mschmidt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rct@gherkin.frus.com \
    --cc=stable@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.