Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: OCTEON: add put_device() after of_find_device_by_node()

This was found by coccicheck:
./arch/mips/cavium-octeon/octeon-platform.c, 332, 1-7, ERROR missing
put_device; call of_find_device_by_node on line 324, but without a
corresponding object release within this function.
./arch/mips/cavium-octeon/octeon-platform.c, 395, 1-7, ERROR missing
put_device; call of_find_device_by_node on line 387, but without a
corresponding object release within this function.
./arch/mips/cavium-octeon/octeon-usb.c, 512, 3-9, ERROR missing
put_device; call of_find_device_by_node on line 515, but without a
corresponding object release within this function.
./arch/mips/cavium-octeon/octeon-usb.c, 543, 1-7, ERROR missing
put_device; call of_find_device_by_node on line 515, but without a
corresponding object release within this function.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Ye Guojin and committed by
Thomas Bogendoerfer
858779df 906c6bc6

+3
+2
arch/mips/cavium-octeon/octeon-platform.c
··· 328 328 329 329 pd->dev.platform_data = &octeon_ehci_pdata; 330 330 octeon_ehci_hw_start(&pd->dev); 331 + put_device(&pd->dev); 331 332 332 333 return ret; 333 334 } ··· 392 391 393 392 pd->dev.platform_data = &octeon_ohci_pdata; 394 393 octeon_ohci_hw_start(&pd->dev); 394 + put_device(&pd->dev); 395 395 396 396 return ret; 397 397 }
+1
arch/mips/cavium-octeon/octeon-usb.c
··· 537 537 devm_iounmap(&pdev->dev, base); 538 538 devm_release_mem_region(&pdev->dev, res->start, 539 539 resource_size(res)); 540 + put_device(&pdev->dev); 540 541 } 541 542 } while (node != NULL); 542 543