Skip to content

Commit 22b77ab

Browse files
Rongronggg91Naim
authored andcommitted
platform/x86: lenovo-wmi-other: Balance component bind and unbind
When lwmi_om_master_bind() fails, the master device's components are left bound, with the aggregate device destroyed due to the failure (found by sashiko.dev [1]). Balance calls to component_bind_all() and component_unbind_all() when an error is propagated to the component framework. No functional change intended. Fixes: edc4b18 ("platform/x86: Add Lenovo Other Mode WMI Driver") Cc: stable@vger.kernel.org Link: https://sashiko.dev/#/patchset/20260331181208.421552-1-derekjohn.clark%40gmail.com [1] Signed-off-by: Rong Zhang <i@rong.moe>
1 parent fba2f22 commit 22b77ab

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/platform/x86/lenovo/wmi-other.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,11 @@ static int lwmi_om_master_bind(struct device *dev)
10681068

10691069
priv->cd00_list = binder.cd00_list;
10701070
priv->cd01_list = binder.cd01_list;
1071-
if (!priv->cd00_list || !priv->cd01_list)
1071+
if (!priv->cd00_list || !priv->cd01_list) {
1072+
component_unbind_all(dev, NULL);
1073+
10721074
return -ENODEV;
1075+
}
10731076

10741077
lwmi_om_fan_info_collect_cd00(priv);
10751078

0 commit comments

Comments
 (0)