[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200721134718.1277347-1-yukuai3@huawei.com>
Date: Tue, 21 Jul 2020 21:47:18 +0800
From: Yu Kuai <yukuai3@...wei.com>
To: <tsbogend@...ha.franken.de>, <huanglllzu@...il.com>,
<chenhc@...ote.com>, <Steven.Hill@...ium.com>,
<david.daney@...ium.com>, <jhogan@...nel.org>
CC: <linux-mips@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<yi.zhang@...wei.com>, <yukuai3@...wei.com>
Subject: [PATCH] MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init()
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@...wei.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
Powered by blists - more mailing lists