[Question] Dead code in __ip_vs_init() net init functions?
Ingyu Jang <[email protected]> Sat, 31 Jan 2026 17:11:07 +0900
| Newsgroups | org.kernel.vger.lvs-devel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
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