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 19:32:39 -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> <1b68c6791001181542p618a8d47n45a120e51cfed1f1@mail.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: jassi brar Return-path: In-Reply-To: <1b68c6791001181542p618a8d47n45a120e51cfed1f1-JsoAwUIsXosN+BqQ9rBEUg@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 4:42 PM, jassi brar wrot= e: > On Tue, Jan 19, 2010 at 3:12 AM, Grant Likely = wrote: >> On Mon, Jan 18, 2010 at 2:50 AM, =A0 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_dev= ice *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, resour= ce_size(mem_res)); >> >> >> request_mem_region() in in an unconditional path in the .probe() hook. >> =A0Are you seeing failure on the remove path? > No failure, just warnings upon running some static code analyzer. Okay. For future reference, it makes my job easier (and more likely that I'll pick up the patch) if the commit log states why a change is being made, and not just what. g. -- = Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. ---------------------------------------------------------------------------= --- 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