diff options
author | Duoming Zhou <duoming@zju.edu.cn> | 2024-05-09 17:36:33 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-30 09:44:39 +0200 |
commit | 5954945db960bfb8edad4234c1d1a13fb48e7424 (patch) | |
tree | 1621f93ab5756bebf31cbdc3e9a4cd5d83696906 /drivers/cdx/controller/cdx_controller.h | |
parent | 130be64399dd18a268e28207a1e7029fb6713234 (diff) |
ax25: Use kernel universal linked list to implement ax25_dev_list
[ Upstream commit a7d6e36b9ad052926ba2ecba3a59d8bb67dabcb4 ]
The origin ax25_dev_list implements its own single linked list,
which is complicated and error-prone. For example, when deleting
the node of ax25_dev_list in ax25_dev_device_down(), we have to
operate on the head node and other nodes separately.
This patch uses kernel universal linked list to replace original
ax25_dev_list, which make the operation of ax25_dev_list easier.
We should do "dev->ax25_ptr = ax25_dev;" and "dev->ax25_ptr = NULL;"
while holding the spinlock, otherwise the ax25_dev_device_up() and
ax25_dev_device_down() could race.
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/85bba3af651ca0e1a519da8d0d715b949891171c.1715247018.git.duoming@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: b505e0319852 ("ax25: Fix reference count leak issues of ax25_dev")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/cdx/controller/cdx_controller.h')
0 files changed, 0 insertions, 0 deletions