diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 9230402c45afcbe0c1a06188b83c99a3f39a104b..4968c4ced385f0c46a46bbd903586bef7c68dc12 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -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;