diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2008-03-21 17:55:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-25 00:16:45 -0400 |
commit | 119fc8c9acde650fb92b44c34ea6fc84feb0f6dd (patch) | |
tree | 7210bc10f578254b107b02d9657a95226a0ed94b /drivers/usb/host | |
parent | e04d80b03d2a116ddd6eb9140c8c83760c315b94 (diff) |
USB: test for NULL return from platform_get_resource() in ohci_hcd_sm501_drv_remove()
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>
Acked-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ohci-sm501.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index ab1e366d7790..54b6ac2e3e4a 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) | |||
199 | usb_put_hcd(hcd); | 199 | usb_put_hcd(hcd); |
200 | dma_release_declared_memory(&pdev->dev); | 200 | dma_release_declared_memory(&pdev->dev); |
201 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 201 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
202 | release_mem_region(mem->start, mem->end - mem->start + 1); | 202 | if (mem) |
203 | release_mem_region(mem->start, mem->end - mem->start + 1); | ||
203 | 204 | ||
204 | /* mask interrupts and disable power */ | 205 | /* mask interrupts and disable power */ |
205 | 206 | ||