From: Joe Perches Date: Sun, 11 Nov 2007 05:36:04 +0000 (-0800) Subject: [NET]: Fix infinite loop in dev_mc_unsync(). X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e9671fcb3bef1fe2e71aa0456bd5b7eec9e8de4d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [NET]: Fix infinite loop in dev_mc_unsync(). From: Joe Perches Based upon an initial patch and report by Luis R. Rodriguez. Signed-off-by: David S. Miller --- diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index ae354057d84c..647973daca2b 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c @@ -168,13 +168,13 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from) da = from->mc_list; while (da != NULL) { next = da->next; - if (!da->da_synced) - continue; - __dev_addr_delete(&to->mc_list, &to->mc_count, - da->da_addr, da->da_addrlen, 0); - da->da_synced = 0; - __dev_addr_delete(&from->mc_list, &from->mc_count, - da->da_addr, da->da_addrlen, 0); + if (da->da_synced) { + __dev_addr_delete(&to->mc_list, &to->mc_count, + da->da_addr, da->da_addrlen, 0); + da->da_synced = 0; + __dev_addr_delete(&from->mc_list, &from->mc_count, + da->da_addr, da->da_addrlen, 0); + } da = next; } __dev_set_rx_mode(to);