diff options
author | Zheng Bin <zhengbin13@huawei.com> | 2022-05-11 11:35:07 +0800 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-05-22 15:58:31 +1000 |
commit | 426e5805226358dbe9af233347c5bf3c81f2125c (patch) | |
tree | d2290739b2b15ff033d7c2f2d068ccf7455826e6 | |
parent | 0e0946e22f3665d27325d389ff45ade6e93f3678 (diff) | |
download | linux-426e5805226358dbe9af233347c5bf3c81f2125c.tar.gz linux-426e5805226358dbe9af233347c5bf3c81f2125c.tar.bz2 linux-426e5805226358dbe9af233347c5bf3c81f2125c.zip |
powerpc/pseries/vas: Call misc_deregister if sysfs init fails
Undo effects of misc_register if sysfs init fails after
misc_register.
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220511033507.2745992-1-zhengbin13@huawei.com
-rw-r--r-- | arch/powerpc/platforms/pseries/vas-sysfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/vas-sysfs.c b/arch/powerpc/platforms/pseries/vas-sysfs.c index d06c0a06de8b..f9f682724e77 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; } } |