Skip to content

Commit 5bcca36

Browse files
jhovoldgregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent eaa0d30 commit 5bcca36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/base/component.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ EXPORT_SYMBOL_GPL(component_master_is_bound);
586586
static void component_unbind(struct component *component,
587587
struct aggregate_device *adev, void *data)
588588
{
589-
WARN_ON(!component->bound);
589+
if (WARN_ON(!component->bound))
590+
return;
590591

591592
dev_dbg(adev->parent, "unbinding %s component %p (ops %ps)\n",
592593
dev_name(component->dev), component, component->ops);

0 commit comments

Comments
 (0)