summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunyu Xiao <runyu.xiao@seu.edu.cn>2026-07-01 20:40:17 +0800
committerPaolo Abeni <pabeni@redhat.com>2026-07-08 10:34:21 +0200
commit4fa0619d039f561dd2207055cf21a10abaeebe0e (patch)
tree3f9852bcd1c9e2f055e81afccfcc213ef5e5069e
parent0be5c3f0fbef3679f50f345b9237b8f9ea5de4e9 (diff)
net: rmnet: annotate endpoint lookup under RTNL
rmnet_get_endpoint() is shared by packet receive paths and RTNL-protected control paths. The receive paths already run under RCU/BH context through the RX handler, while the control paths reach rmnet_get_endpoint() after obtaining the rmnet port with rmnet_get_port_rtnl(). The helper walks port->muxed_ep[] with hlist_for_each_entry_rcu(). Pass lockdep_rtnl_is_held() as the non-RCU protection condition so CONFIG_PROVE_RCU_LIST can see the RTNL-protected control-path calls while preserving the existing RCU-reader behavior for data paths. This was found by our static analysis tool and then manually reviewed against the current tree. The dynamic triage evidence is a target-matched CONFIG_PROVE_RCU_LIST warning; the change is limited to documenting the existing protection contract. This is a lockdep annotation cleanup. It does not change endpoint lifetime or hash updates. Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn> Reviewed-by: Subash Abhinov Kasiviswanathan <subash.a.kasiviswanathan@oss.qualcomm.com> Link: https://patch.msgid.link/20260701124017.3205729-1-runyu.xiao@seu.edu.cn Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index 78d4df55740a..bed6f63facf2 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -423,7 +423,8 @@ struct rmnet_endpoint *rmnet_get_endpoint(struct rmnet_port *port, u8 mux_id)
{
struct rmnet_endpoint *ep;
- hlist_for_each_entry_rcu(ep, &port->muxed_ep[mux_id], hlnode) {
+ hlist_for_each_entry_rcu(ep, &port->muxed_ep[mux_id], hlnode,
+ lockdep_rtnl_is_held()) {
if (ep->mux_id == mux_id)
return ep;
}