From: Vladislav Zolotarov Date: Sun, 9 Jan 2011 02:20:34 +0000 (+0000) Subject: bnx2x: Fix the race on bp->stats_pending. X-Git-Tag: MMI-PSA29.97-13-9~20736^2~249 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9bcb8018cf7af1f00f35cad4b121897cac077269;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git bnx2x: Fix the race on bp->stats_pending. Fix the race on bp->stats_pending between the timer and a LINK_UP event handler. Signed-off-by: Vladislav Zolotarov Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c index 6e4d9b144cc4..bda60d590fa8 100644 --- a/drivers/net/bnx2x/bnx2x_stats.c +++ b/drivers/net/bnx2x/bnx2x_stats.c @@ -158,6 +158,11 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp) spin_lock_bh(&bp->stats_lock); + if (bp->stats_pending) { + spin_unlock_bh(&bp->stats_lock); + return; + } + ramrod_data.drv_counter = bp->stats_counter++; ramrod_data.collect_port = bp->port.pmf ? 1 : 0; for_each_eth_queue(bp, i)