提交 119fc8c9 编写于 作者: J Jesper Juhl 提交者: Greg Kroah-Hartman

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: NJesper Juhl <jesper.juhl@gmail.com>
Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Acked-by: NMagnus Damm <magnus.damm@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 e04d80b0
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册