lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 28 Jul 2020 10:27:46 +0800
From:   Qinglang Miao <miaoqinglang@...wei.com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:     <linux-m68k@...ts.linux-m68k.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] m68k/amiga: missing platform_device_unregister() on error in amiga_init_devices()

Add the missing platform_device_unregister() before return
from amiga_init_devices() in the error handling case.

Signed-off-by: Qinglang Miao <miaoqinglang@...wei.com>
---
 arch/m68k/amiga/platform.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c
index d34029d7b..afa2782c6 100644
--- a/arch/m68k/amiga/platform.c
+++ b/arch/m68k/amiga/platform.c
@@ -188,8 +188,10 @@ static int __init amiga_init_devices(void)
 			return PTR_ERR(pdev);
 		error = platform_device_add_data(pdev, &a1200_ide_pdata,
 						 sizeof(a1200_ide_pdata));
-		if (error)
+		if (error) {
+			platform_device_unregister(pdev);
 			return error;
+		}
 	}
 
 	if (AMIGAHW_PRESENT(A4000_IDE)) {
@@ -199,8 +201,10 @@ static int __init amiga_init_devices(void)
 			return PTR_ERR(pdev);
 		error = platform_device_add_data(pdev, &a4000_ide_pdata,
 						 sizeof(a4000_ide_pdata));
-		if (error)
+		if (error) {
+			platform_device_unregister(pdev);
 			return error;
+		}
 	}
 
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ