summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan+linaro@kernel.org>2025-02-28 09:18:24 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-15 18:05:40 +0200
commit5bcca36898aab843eb259984c29de7ff9e0d8723 (patch)
treee350d355efe5391448d4c3165c2eccbe8550bcdf
parenteaa0d30216c1d54b157ea0ad7f35ba76f6e9a825 (diff)
component: do not try to unbind unbound components
Error handling is apparently hard and driver authors often get it wrong. Continue to warn but do not try to unbind components that have never been bound in order to avoid crashing systems where such a buggy teardown path is hit. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20250228081824.4640-1-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/component.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/component.c b/drivers/base/component.c
index abe60eb45c55..024ad9471b8a 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -586,7 +586,8 @@ EXPORT_SYMBOL_GPL(component_master_is_bound);
static void component_unbind(struct component *component,
struct aggregate_device *adev, void *data)
{
- WARN_ON(!component->bound);
+ if (WARN_ON(!component->bound))
+ return;
dev_dbg(adev->parent, "unbinding %s component %p (ops %ps)\n",
dev_name(component->dev), component, component->ops);