Re: [RFC] component: Fix: Unassign components' masters if bringing up master fails

From: Daniel Stone
Date: Mon Feb 15 2016 - 11:36:11 EST


Hi Archit,

On 11 February 2016 at 09:35, Archit Taneja <architt@xxxxxxxxxxxxxx> wrote:
> component_master_add_with_match can fail if the master's bind op doesn't
> go through successfully. In such a scenario, all the components in the
> master's match array have their 'master' pointer set to the given master.
> These pointers need to be set to NULL again. If they aren't, successive
> calls to component_master_add_with_match will fail because the driver
> thinks these components already have a master.
>
> This issue can be seen when a driver defers probe because of missing
> resources. It is seen after the introduction of commit:
>
> "component: track components via array rather than list"
>
> Add 'master_remove_components' which sets the all the components's masters
> in the match array to NULL. This function is also re-used in
> component_master_del and replaces code that did the same thing.

Jon already fixed this (in a slightly more limited way perhaps?) in 57480484f9.

Cheers,
Daniel