Skip to content

Commit cbd070a

Browse files
chenhanxiaoummakynes
authored andcommitted
ipvs: properly dereference pe in ip_vs_add_service
Use pe directly to resolve sparse warning: net/netfilter/ipvs/ip_vs_ctl.c:1471:27: warning: dereference of noderef expression Fixes: 39b9722 ("ipvs: handle connections started by real-servers") Signed-off-by: Chen Hanxiao <[email protected]> Acked-by: Julian Anastasov <[email protected]> Acked-by: Simon Horman <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 0935ee6 commit cbd070a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

net/netfilter/ipvs/ip_vs_ctl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,18 +1459,18 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u,
14591459
if (ret < 0)
14601460
goto out_err;
14611461

1462-
/* Bind the ct retriever */
1463-
RCU_INIT_POINTER(svc->pe, pe);
1464-
pe = NULL;
1465-
14661462
/* Update the virtual service counters */
14671463
if (svc->port == FTPPORT)
14681464
atomic_inc(&ipvs->ftpsvc_counter);
14691465
else if (svc->port == 0)
14701466
atomic_inc(&ipvs->nullsvc_counter);
1471-
if (svc->pe && svc->pe->conn_out)
1467+
if (pe && pe->conn_out)
14721468
atomic_inc(&ipvs->conn_out_counter);
14731469

1470+
/* Bind the ct retriever */
1471+
RCU_INIT_POINTER(svc->pe, pe);
1472+
pe = NULL;
1473+
14741474
/* Count only IPv4 services for old get/setsockopt interface */
14751475
if (svc->af == AF_INET)
14761476
ipvs->num_services++;

0 commit comments

Comments
 (0)