Skip to content

Commit 21f74bf

Browse files
committed
platform/x86: dell-wmi-sysman: Cleanup sysman_init() error-exit handling
jira LE-3064 Rebuild_History Non-Buildable kernel-4.18.0-553.53.1.el8_10 commit-author Hans de Goede <hdegoede@redhat.com> commit eaa1dcc Empty-Commit: Cherry-Pick Conflicts during history rebuild. Will be included in final tarball splat. Ref for failed cherry-pick at: ciq/ciq_backports/kernel-4.18.0-553.53.1.el8_10/eaa1dcc7.failed Cleanup sysman_init() error-exit handling: 1. There is no need for the fail_reset_bios and fail_authentication_kset eror-exit cases, these can be handled by release_attributes_data() 2. Rename all the labels from fail_what_failed, to err_what_to_cleanup this is the usual way to name these and avoids the need to rename them when extra steps are added. Fixes: e8a60aa ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems") Cc: Divya Bharathi <Divya_Bharathi@dell.com> Cc: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210321115901.35072-6-hdegoede@redhat.com (cherry picked from commit eaa1dcc) Signed-off-by: Jonathan Maple <jmaple@ciq.com> # Conflicts: # drivers/platform/x86/dell-wmi-sysman/sysman.c
1 parent 034af00 commit 21f74bf

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
platform/x86: dell-wmi-sysman: Cleanup sysman_init() error-exit handling
2+
3+
jira LE-3064
4+
Rebuild_History Non-Buildable kernel-4.18.0-553.53.1.el8_10
5+
commit-author Hans de Goede <hdegoede@redhat.com>
6+
commit eaa1dcc79694674494620ee62098b937ef758df8
7+
Empty-Commit: Cherry-Pick Conflicts during history rebuild.
8+
Will be included in final tarball splat. Ref for failed cherry-pick at:
9+
ciq/ciq_backports/kernel-4.18.0-553.53.1.el8_10/eaa1dcc7.failed
10+
11+
Cleanup sysman_init() error-exit handling:
12+
13+
1. There is no need for the fail_reset_bios and fail_authentication_kset
14+
eror-exit cases, these can be handled by release_attributes_data()
15+
16+
2. Rename all the labels from fail_what_failed, to err_what_to_cleanup
17+
this is the usual way to name these and avoids the need to rename
18+
them when extra steps are added.
19+
20+
Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
21+
Cc: Divya Bharathi <Divya_Bharathi@dell.com>
22+
Cc: Mario Limonciello <mario.limonciello@dell.com>
23+
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
24+
Link: https://lore.kernel.org/r/20210321115901.35072-6-hdegoede@redhat.com
25+
(cherry picked from commit eaa1dcc79694674494620ee62098b937ef758df8)
26+
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
27+
28+
# Conflicts:
29+
# drivers/platform/x86/dell-wmi-sysman/sysman.c
30+
diff --cc drivers/platform/x86/dell-wmi-sysman/sysman.c
31+
index 641f87850439,99dc2f3bdf49..000000000000
32+
--- a/drivers/platform/x86/dell-wmi-sysman/sysman.c
33+
+++ b/drivers/platform/x86/dell-wmi-sysman/sysman.c
34+
@@@ -512,14 -514,14 +512,14 @@@ static int __init sysman_init(void
35+
ret = init_bios_attr_pass_interface();
36+
if (ret || !wmi_priv.password_attr_wdev) {
37+
pr_debug("failed to initialize pass interface\n");
38+
- goto fail_pass_interface;
39+
+ goto err_exit_bios_attr_set_interface;
40+
}
41+
42+
- ret = class_register(&firmware_attributes_class);
43+
+ ret = fw_attributes_class_get(&fw_attr_class);
44+
if (ret)
45+
- goto fail_class;
46+
+ goto err_exit_bios_attr_pass_interface;
47+
48+
- wmi_priv.class_dev = device_create(&firmware_attributes_class, NULL, MKDEV(0, 0),
49+
+ wmi_priv.class_dev = device_create(fw_attr_class, NULL, MKDEV(0, 0),
50+
NULL, "%s", DRIVER_NAME);
51+
if (IS_ERR(wmi_priv.class_dev)) {
52+
ret = PTR_ERR(wmi_priv.class_dev);
53+
@@@ -572,34 -574,21 +572,41 @@@
54+
55+
return 0;
56+
57+
- fail_create_group:
58+
+ err_release_attributes_data:
59+
release_attributes_data();
60+
61+
++<<<<<<< HEAD:drivers/platform/x86/dell-wmi-sysman/sysman.c
62+
+fail_reset_bios:
63+
+ if (wmi_priv.authentication_dir_kset) {
64+
+ kset_unregister(wmi_priv.authentication_dir_kset);
65+
+ wmi_priv.authentication_dir_kset = NULL;
66+
+ }
67+
+
68+
+fail_authentication_kset:
69+
+ if (wmi_priv.main_dir_kset) {
70+
+ kset_unregister(wmi_priv.main_dir_kset);
71+
+ wmi_priv.main_dir_kset = NULL;
72+
+ }
73+
+
74+
+fail_main_kset:
75+
+ device_destroy(fw_attr_class, MKDEV(0, 0));
76+
+
77+
+fail_classdev:
78+
+ fw_attributes_class_put();
79+
++=======
80+
+ err_destroy_classdev:
81+
+ device_destroy(&firmware_attributes_class, MKDEV(0, 0));
82+
+
83+
+ err_unregister_class:
84+
+ class_unregister(&firmware_attributes_class);
85+
++>>>>>>> eaa1dcc79694 (platform/x86: dell-wmi-sysman: Cleanup sysman_init() error-exit handling):drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
86+
87+
- fail_class:
88+
+ err_exit_bios_attr_pass_interface:
89+
exit_bios_attr_pass_interface();
90+
91+
- fail_pass_interface:
92+
+ err_exit_bios_attr_set_interface:
93+
exit_bios_attr_set_interface();
94+
95+
- fail_set_interface:
96+
return ret;
97+
}
98+
99+
* Unmerged path drivers/platform/x86/dell-wmi-sysman/sysman.c

0 commit comments

Comments
 (0)