Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755405AbZICNyl (ORCPT ); Thu, 3 Sep 2009 09:54:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755102AbZICNyl (ORCPT ); Thu, 3 Sep 2009 09:54:41 -0400 Received: from smtp.infotech.no ([82.134.31.41]:52527 "EHLO elrond.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754451AbZICNyk (ORCPT ); Thu, 3 Sep 2009 09:54:40 -0400 Message-ID: <4A9FCA9D.8010702@interlog.com> Date: Thu, 03 Sep 2009 09:54:37 -0400 From: Douglas Gilbert Reply-To: dgilbert@interlog.com User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Michal Schmidt CC: linux-scsi@vger.kernel.org, Bob Tracy , linux-kernel@vger.kernel.org, stable@kernel.org Subject: Re: [PATCH] sg: fix oops in the error path in sg_build_indirect() References: <20090903033945.GA20755@gherkin.frus.com> <20090903142708.0b820ca1@leela> In-Reply-To: <20090903142708.0b820ca1@leela> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 915 Lines: 31 Michal Schmidt wrote: > 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 > Reported-by: Bob Tracy > --- > > 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; > -- Ouch. Signed-off-by: Douglas Gilbert -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/