All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init()
@ 2020-07-21 13:47 Yu Kuai
  2020-07-24  9:10 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Yu Kuai @ 2020-07-21 13:47 UTC (permalink / raw)
  To: tsbogend, huanglllzu, chenhc, Steven.Hill, david.daney, jhogan
  Cc: linux-mips, linux-kernel, yi.zhang, yukuai3

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: 93e502b3c2d4 ("MIPS: OCTEON: Platform support for OCTEON III USB controller")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 arch/mips/cavium-octeon/octeon-usb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
index 1fd85c559700..950e6c6e8629 100644
--- a/arch/mips/cavium-octeon/octeon-usb.c
+++ b/arch/mips/cavium-octeon/octeon-usb.c
@@ -518,6 +518,7 @@ static int __init dwc3_octeon_device_init(void)
 
 			res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 			if (res == NULL) {
+				put_device(&pdev->dev);
 				dev_err(&pdev->dev, "No memory resources\n");
 				return -ENXIO;
 			}
@@ -529,8 +530,10 @@ static int __init dwc3_octeon_device_init(void)
 			 * know the difference.
 			 */
 			base = devm_ioremap_resource(&pdev->dev, res);
-			if (IS_ERR(base))
+			if (IS_ERR(base)) {
+				put_device(&pdev->dev);
 				return PTR_ERR(base);
+			}
 
 			mutex_lock(&dwc3_octeon_clocks_mutex);
 			dwc3_octeon_clocks_start(&pdev->dev, (u64)base);
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init()
  2020-07-21 13:47 [PATCH] MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init() Yu Kuai
@ 2020-07-24  9:10 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2020-07-24  9:10 UTC (permalink / raw)
  To: Yu Kuai
  Cc: huanglllzu, chenhc, Steven.Hill, david.daney, jhogan, linux-mips,
	linux-kernel, yi.zhang

On Tue, Jul 21, 2020 at 09:47:18PM +0800, Yu Kuai wrote:
> 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: 93e502b3c2d4 ("MIPS: OCTEON: Platform support for OCTEON III USB controller")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>  arch/mips/cavium-octeon/octeon-usb.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-24  9:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 13:47 [PATCH] MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init() Yu Kuai
2020-07-24  9:10 ` Thomas Bogendoerfer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.