Skip to content

Commit

Permalink
[SCSI] sg: fix oops in the error path in sg_build_indirect()
Browse files Browse the repository at this point in the history
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>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Michal Schmidt authored and James Bottomley committed Sep 12, 2009
1 parent b437b95 commit e71044e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size)
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;
Expand Down

0 comments on commit e71044e

Please sign in to comment.