mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: linux-usb@vger.kernel.org, Roman Weissgaerber <weissg@vienna.at>,
	Lennert Buytenhek <kernel@wantstofly.org>,
	Greg KH <greg@kroah.com>, LKML <linux-kernel@vger.kernel.org>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: [PATCH] test for NULL return from platform_get_resource() in ohci_hcd_sm501_drv_remove()
Date: Thu, 27 Mar 2008 12:27:46 -0700	[thread overview]
Message-ID: <200803271227.46818.david-b@pacbell.net> (raw)
In-Reply-To: <alpine.LNX.1.00.0803212250210.9597@dragon.funnycrock.com>

On Friday 21 March 2008, Jesper Juhl wrote:
> 
> platform_get_resource() may return null, so although it seems it will never
> do so here unless there's a bug elsewhere, it does no harm to be defensive 
> and test.
> 
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>

Acked-by: David Brownell <dbrownell@users.sourceforge.net>

(and cc the author of that code:  Magnus Damm <magnus.damm@gmail.com>)

> ---
> 
>  ohci-sm501.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
> index a970701..1ffc272 100644
> --- a/drivers/usb/host/ohci-sm501.c
> +++ b/drivers/usb/host/ohci-sm501.c
> @@ -199,7 +199,8 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev)
>  	usb_put_hcd(hcd);
>  	dma_release_declared_memory(&pdev->dev);
>  	mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -	release_mem_region(mem->start, mem->end - mem->start + 1);
> +	if (mem)
> +		release_mem_region(mem->start, mem->end - mem->start + 1);
>  
>  	/* mask interrupts and disable power */
>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



  reply	other threads:[~2008-03-27 19:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-21 21:55 Jesper Juhl
2008-03-27 19:27 ` David Brownell [this message]
2008-03-28  8:48   ` Magnus Damm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200803271227.46818.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=jesper.juhl@gmail.com \
    --cc=kernel@wantstofly.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=weissg@vienna.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®