All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] powerpc/pseries/vas: Call misc_deregister if sysfs init fails
@ 2022-05-11  3:35 ` Zheng Bin
  0 siblings, 0 replies; 3+ messages in thread
From: Zheng Bin @ 2022-05-11  3:35 UTC (permalink / raw)
  To: mpe, benh, paulus, haren, gregkh, npiggin, linuxppc-dev, linux-kernel
  Cc: zhengbin13, gaochao49

Undo effects of misc_register if sysfs init fails after
misc_register.

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 arch/powerpc/platforms/pseries/vas-sysfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/vas-sysfs.c b/arch/powerpc/platforms/pseries/vas-sysfs.c
index ec65586cbeb3..89ed64d61da7 100644
--- a/arch/powerpc/platforms/pseries/vas-sysfs.c
+++ b/arch/powerpc/platforms/pseries/vas-sysfs.c
@@ -248,6 +248,7 @@ int __init sysfs_pseries_vas_init(struct vas_all_caps *vas_caps)
 	pseries_vas_kobj = kobject_create_and_add("vas0",
 					&vas_miscdev.this_device->kobj);
 	if (!pseries_vas_kobj) {
+		misc_deregister(&vas_miscdev);
 		pr_err("Failed to create VAS sysfs entry\n");
 		return -ENOMEM;
 	}
@@ -259,6 +260,7 @@ int __init sysfs_pseries_vas_init(struct vas_all_caps *vas_caps)
 		if (!gzip_caps_kobj) {
 			pr_err("Failed to create VAS GZIP capability entry\n");
 			kobject_put(pseries_vas_kobj);
+			misc_deregister(&vas_miscdev);
 			return -ENOMEM;
 		}
 	}
--
2.31.1


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

* [PATCH -next] powerpc/pseries/vas: Call misc_deregister if sysfs init fails
@ 2022-05-11  3:35 ` Zheng Bin
  0 siblings, 0 replies; 3+ messages in thread
From: Zheng Bin @ 2022-05-11  3:35 UTC (permalink / raw)
  To: mpe, benh, paulus, haren, gregkh, npiggin, linuxppc-dev, linux-kernel
  Cc: zhengbin13, gaochao49

Undo effects of misc_register if sysfs init fails after
misc_register.

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 arch/powerpc/platforms/pseries/vas-sysfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/vas-sysfs.c b/arch/powerpc/platforms/pseries/vas-sysfs.c
index ec65586cbeb3..89ed64d61da7 100644
--- a/arch/powerpc/platforms/pseries/vas-sysfs.c
+++ b/arch/powerpc/platforms/pseries/vas-sysfs.c
@@ -248,6 +248,7 @@ int __init sysfs_pseries_vas_init(struct vas_all_caps *vas_caps)
 	pseries_vas_kobj = kobject_create_and_add("vas0",
 					&vas_miscdev.this_device->kobj);
 	if (!pseries_vas_kobj) {
+		misc_deregister(&vas_miscdev);
 		pr_err("Failed to create VAS sysfs entry\n");
 		return -ENOMEM;
 	}
@@ -259,6 +260,7 @@ int __init sysfs_pseries_vas_init(struct vas_all_caps *vas_caps)
 		if (!gzip_caps_kobj) {
 			pr_err("Failed to create VAS GZIP capability entry\n");
 			kobject_put(pseries_vas_kobj);
+			misc_deregister(&vas_miscdev);
 			return -ENOMEM;
 		}
 	}
--
2.31.1


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

* Re: [PATCH -next] powerpc/pseries/vas: Call misc_deregister if sysfs init fails
  2022-05-11  3:35 ` Zheng Bin
  (?)
@ 2022-05-24 11:09 ` Michael Ellerman
  -1 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2022-05-24 11:09 UTC (permalink / raw)
  To: paulus, npiggin, linux-kernel, gregkh, benh, haren, mpe,
	linuxppc-dev, Zheng Bin
  Cc: gaochao49

On Wed, 11 May 2022 11:35:07 +0800, Zheng Bin wrote:
> Undo effects of misc_register if sysfs init fails after
> misc_register.
> 
> 

Applied to powerpc/next.

[1/1] powerpc/pseries/vas: Call misc_deregister if sysfs init fails
      https://git.kernel.org/powerpc/c/426e5805226358dbe9af233347c5bf3c81f2125c

cheers

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

end of thread, other threads:[~2022-05-24 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11  3:35 [PATCH -next] powerpc/pseries/vas: Call misc_deregister if sysfs init fails Zheng Bin
2022-05-11  3:35 ` Zheng Bin
2022-05-24 11:09 ` Michael Ellerman

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.