summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2009-09-03 14:27:08 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-24 08:27:04 -0700
commita9b9f4d868e06a2b98bf760dbd3325c11b03b416 (patch)
tree6ff40ccd899e721438f1d799f1aeab75e2d988f5
parente276bbcae3a15314c94ae97283697d818fbe8a1b (diff)
sg: fix oops in the error path in sg_build_indirect()
commit e71044ee2efa4792e21d243b03d49006db66aec9 upstream. 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> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/scsi/sg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index ff63279b40ea..ab968905d89a 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;