Commit 239ab7a4 authored by Varka Bhadram's avatar Varka Bhadram Committed by Greg Kroah-Hartman

host: ehci-sead3: fix NULL pointer dereference on resource

Fix on accessing NULL pointer dereference on get resource failed.
Signed-off-by: default avatarVarka Bhadram <varkab@cdac.in>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6827f7e3
...@@ -110,14 +110,13 @@ static int ehci_hcd_sead3_drv_probe(struct platform_device *pdev) ...@@ -110,14 +110,13 @@ static int ehci_hcd_sead3_drv_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
hcd->regs = devm_ioremap_resource(&pdev->dev, res); hcd->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(hcd->regs)) { if (IS_ERR(hcd->regs)) {
ret = PTR_ERR(hcd->regs); ret = PTR_ERR(hcd->regs);
goto err1; goto err1;
} }
hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
/* Root hub has integrated TT. */ /* Root hub has integrated TT. */
hcd->has_tt = 1; hcd->has_tt = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment