[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260131081107.2919353-1-ingyujang25@korea.ac.kr>
Date: Sat, 31 Jan 2026 17:11:07 +0900
From: Ingyu Jang <ingyujang25@...ea.ac.kr>
To: lvs-devel@...r.kernel.org
Cc: horms@...ge.net.au,
ja@....bg,
netdev@...r.kernel.org,
Ingyu Jang <ingyujang25@...ea.ac.kr>
Subject: [Question] Dead code in __ip_vs_init() net init functions?
Hi,
I noticed that in net/netfilter/ipvs/ip_vs_core.c, the function
__ip_vs_init() checks the return values of two initialization functions:
- ip_vs_estimator_net_init()
- ip_vs_sync_net_init()
However, both functions always return 0:
ip_vs_estimator_net_init() in ip_vs_est.c only initializes struct
fields and calls __mutex_init(), then returns 0.
ip_vs_sync_net_init() in ip_vs_sync.c only calls __mutex_init()
and spin_lock_init(), then returns 0.
The error handling code (goto estimator_fail, goto sync_fail) can
never be reached.
Is this intentional defensive coding for potential future changes
(e.g., adding memory allocation), or could this be cleaned up?
Thanks,
Ingyu Jang
Powered by blists - more mailing lists