Unverified Commit 2fe2504a authored by Rong Zhang's avatar Rong Zhang Committed by Ilpo Järvinen
Browse files

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.

Reviewed-by: default avatarMark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fixes: edc4b183 ("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: default avatarRong Zhang <i@rong.moe>
Signed-off-by: default avatarDerek J. Clark <derekjohn.clark@gmail.com>
Link: https://patch.msgid.link/20260510042546.436874-4-derekjohn.clark@gmail.com


Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent 55a279ae
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1070,8 +1070,11 @@ static int lwmi_om_master_bind(struct device *dev)

	priv->cd00_list = binder.cd00_list;
	priv->cd01_list = binder.cd01_list;
	if (!priv->cd00_list || !priv->cd01_list)
	if (!priv->cd00_list || !priv->cd01_list) {
		component_unbind_all(dev, NULL);

		return -ENODEV;
	}

	lwmi_om_fan_info_collect_cd00(priv);