ipvs: use list_del_init instead of list_del/INIT_LIST_HEAD
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 5 Sep 2012 18:21:53 +0000 (18:21 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 10 Sep 2012 07:48:55 +0000 (09:48 +0200)
Using list_del_init() instead of list_del() + INIT_LIST_HEAD().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipvs/ip_vs_ctl.c

index 767cc12da0feaf7b97e4cf002628447265d38102..37b38d0791cd0b7557a740f65aa9ce0774ae501c 100644 (file)
@@ -539,8 +539,7 @@ static int ip_vs_rs_unhash(struct ip_vs_dest *dest)
         * Remove it from the rs_table table.
         */
        if (!list_empty(&dest->d_list)) {
-               list_del(&dest->d_list);
-               INIT_LIST_HEAD(&dest->d_list);
+               list_del_init(&dest->d_list);
        }
 
        return 1;