Re: [net v2] net: dsa: microchip: fix race condition

From: Christian Eggers
Date: Tue Oct 06 2020 - 12:31:49 EST


On Tuesday, 6 October 2020, 18:21:25 CEST, Vladimir Oltean wrote:
> On Tue, Oct 06, 2020 at 05:56:51PM +0200, Christian Eggers wrote:
> > - Checking for mib_read_interval in ksz_switch_remove() can be obmitted,
> > as the condition is always true when ksz_switch_remove() is called.
>
> If there's an error in the probe path, I expect that the
> mib_read_interval will not get set, and the delayed workqueue will not
> be scheduled, will it? So I think the check is ok there.

If think that ksz_switch_remove() will not be called at all if there is an
error in the probe path. In all other cases, the work should be queued.

Regards
Christian