From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [PATCH 4/6] SPI: S3C64XX: Check before mem-region release Date: Mon, 18 Jan 2010 11:12:09 -0700 Message-ID: References: <1263808215-16544-1-git-send-email-jassisinghbrar@gmail.com> <1263808215-16544-2-git-send-email-jassisinghbrar@gmail.com> <1263808215-16544-3-git-send-email-jassisinghbrar@gmail.com> <1263808215-16544-4-git-send-email-jassisinghbrar@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, ben-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org To: jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Return-path: In-Reply-To: <1263808215-16544-4-git-send-email-jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Mon, Jan 18, 2010 at 2:50 AM, wrote: > From: Jassi Brar > > Add precautionary check before releasing memory region. > > Signed-off-by: Jassi Brar > --- > =A0drivers/spi/spi_s3c64xx.c | =A0 =A03 ++- > =A01 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c > index 3acf381..0e883f9 100644 > --- a/drivers/spi/spi_s3c64xx.c > +++ b/drivers/spi/spi_s3c64xx.c > @@ -1097,7 +1097,8 @@ static int s3c64xx_spi_remove(struct platform_devic= e *pdev) > =A0 =A0 =A0 =A0iounmap((void *) sdd->regs); > > =A0 =A0 =A0 =A0mem_res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); > - =A0 =A0 =A0 release_mem_region(mem_res->start, resource_size(mem_res)); > + =A0 =A0 =A0 if (mem_res !=3D NULL) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 release_mem_region(mem_res->start, resource= _size(mem_res)); request_mem_region() in in an unconditional path in the .probe() hook. Are you seeing failure on the remove path? g. ---------------------------------------------------------------------------= --- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Confere= nce attendees to learn about information security's most important issues throu= gh interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev