Skip to content

Commit 1aadfae

Browse files
YuKuai-huaweigregkh
authored andcommitted
MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init()
[ Upstream commit e8b9fc1 ] 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: 93e502b ("MIPS: OCTEON: Platform support for OCTEON III USB controller") Signed-off-by: Yu Kuai <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e13f98e commit 1aadfae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/mips/cavium-octeon/octeon-usb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ static int __init dwc3_octeon_device_init(void)
517517

518518
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
519519
if (res == NULL) {
520+
put_device(&pdev->dev);
520521
dev_err(&pdev->dev, "No memory resources\n");
521522
return -ENXIO;
522523
}
@@ -528,8 +529,10 @@ static int __init dwc3_octeon_device_init(void)
528529
* know the difference.
529530
*/
530531
base = devm_ioremap_resource(&pdev->dev, res);
531-
if (IS_ERR(base))
532+
if (IS_ERR(base)) {
533+
put_device(&pdev->dev);
532534
return PTR_ERR(base);
535+
}
533536

534537
mutex_lock(&dwc3_octeon_clocks_mutex);
535538
dwc3_octeon_clocks_start(&pdev->dev, (u64)base);

0 commit comments

Comments
 (0)