]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtase: Fix improper release of ring list entries in rtase_sw_reset
authorJustin Lai <justinlai0215@realtek.com>
Thu, 6 Mar 2025 07:05:10 +0000 (15:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:13 +0000 (12:54 -0700)
commit992a60cdfd9f4586753ce17b06292e6458c36866
tree011f96d76d883bf97607b382e3dfa387bc52a591
parent247347fe0cdd6a11419bc7a94b251557e6b9a9fb
rtase: Fix improper release of ring list entries in rtase_sw_reset

[ Upstream commit 415f135ace7fd824cde083184a922e39156055b5 ]

Since rtase_init_ring, which is called within rtase_sw_reset, adds ring
entries already present in the ring list back into the list, it causes
the ring list to form a cycle. This results in list_for_each_entry_safe
failing to find an endpoint during traversal, leading to an error.
Therefore, it is necessary to remove the previously added ring_list nodes
before calling rtase_init_ring.

Fixes: 079600489960 ("rtase: Implement net_device_ops")
Signed-off-by: Justin Lai <justinlai0215@realtek.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250306070510.18129-1-justinlai0215@realtek.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/realtek/rtase/rtase_main.c