summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2020-07-21 21:47:18 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-19 08:14:58 +0200
commit1aadfae64db50bba5d81a9a6724a62ed4a60ddf1 (patch)
tree89379df0efa0a2407d8e98a73e6a6737a4359027 /arch/mips
parente13f98ef31b3c3fd8e4788f312576f9f414314c2 (diff)
downloadlinux-stable-1aadfae64db50bba5d81a9a6724a62ed4a60ddf1.tar.gz
linux-stable-1aadfae64db50bba5d81a9a6724a62ed4a60ddf1.tar.bz2
linux-stable-1aadfae64db50bba5d81a9a6724a62ed4a60ddf1.zip
MIPS: OCTEON: add missing put_device() call in dwc3_octeon_device_init()
[ Upstream commit e8b9fc10f2615b9a525fce56981e40b489528355 ] 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> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/cavium-octeon/octeon-usb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
index bfdfaf32d2c4..75189ff2f3c7 100644
--- a/arch/mips/cavium-octeon/octeon-usb.c
+++ b/arch/mips/cavium-octeon/octeon-usb.c
@@ -517,6 +517,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;
}
@@ -528,8 +529,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);