MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init()
[ Upstream commite8b9fc10f2
] if of_find_device_by_node() succeed, dwc3_octeon_device_init() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling for this function implementation. Fixes:93e502b3c2
("MIPS: OCTEON: Platform support for OCTEON III USB controller") Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
db2eabff57
commit
b8f3c361ca
|
@ -518,6 +518,7 @@ static int __init dwc3_octeon_device_init(void)
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
|
put_device(&pdev->dev);
|
||||||
dev_err(&pdev->dev, "No memory resources\n");
|
dev_err(&pdev->dev, "No memory resources\n");
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
@ -529,8 +530,10 @@ static int __init dwc3_octeon_device_init(void)
|
||||||
* know the difference.
|
* know the difference.
|
||||||
*/
|
*/
|
||||||
base = devm_ioremap_resource(&pdev->dev, res);
|
base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (IS_ERR(base))
|
if (IS_ERR(base)) {
|
||||||
|
put_device(&pdev->dev);
|
||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
|
}
|
||||||
|
|
||||||
mutex_lock(&dwc3_octeon_clocks_mutex);
|
mutex_lock(&dwc3_octeon_clocks_mutex);
|
||||||
dwc3_octeon_clocks_start(&pdev->dev, (u64)base);
|
dwc3_octeon_clocks_start(&pdev->dev, (u64)base);
|
||||||
|
|
Loading…
Reference in New Issue