lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200803271227.46818.david-b@pacbell.net>
Date:	Thu, 27 Mar 2008 12:27:46 -0700
From:	David Brownell <david-b@...bell.net>
To:	Jesper Juhl <jesper.juhl@...il.com>
Cc:	linux-usb@...r.kernel.org, Roman Weissgaerber <weissg@...nna.at>,
	Lennert Buytenhek <kernel@...tstofly.org>,
	Greg KH <greg@...ah.com>, LKML <linux-kernel@...r.kernel.org>,
	Magnus Damm <magnus.damm@...il.com>
Subject: Re: [PATCH] test for NULL return from platform_get_resource() in ohci_hcd_sm501_drv_remove()

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@...il.com>

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

(and cc the author of that code:  Magnus Damm <magnus.damm@...il.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@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ