team: avoid race condition in scheduling delayed work
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / net / team / team.c
index 26d8c29..979fe43 100644 (file)
@@ -647,7 +647,7 @@ static void team_notify_peers(struct team *team)
 {
        if (!team->notify_peers.count || !netif_running(team->dev))
                return;
-       atomic_set(&team->notify_peers.count_pending, team->notify_peers.count);
+       atomic_add(team->notify_peers.count, &team->notify_peers.count_pending);
        schedule_delayed_work(&team->notify_peers.dw, 0);
 }
 
@@ -687,7 +687,7 @@ static void team_mcast_rejoin(struct team *team)
 {
        if (!team->mcast_rejoin.count || !netif_running(team->dev))
                return;
-       atomic_set(&team->mcast_rejoin.count_pending, team->mcast_rejoin.count);
+       atomic_add(team->mcast_rejoin.count, &team->mcast_rejoin.count_pending);
        schedule_delayed_work(&team->mcast_rejoin.dw, 0);
 }