summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTakamitsu Iwai <takamitz@amazon.co.jp>2025-08-23 17:58:55 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-04 15:26:28 +0200
commitbe9f3ea6592b3f9c7c3b8c1b81898ea24ba4908b (patch)
tree653b245a9028d60f48f005ca2bd775065f9e6ea7 /include
parentfb45a6b1d69d655667f8a00c0a74290c41ddd144 (diff)
downloadlinux-be9f3ea6592b3f9c7c3b8c1b81898ea24ba4908b.tar.gz
linux-be9f3ea6592b3f9c7c3b8c1b81898ea24ba4908b.tar.bz2
linux-be9f3ea6592b3f9c7c3b8c1b81898ea24ba4908b.zip
net: rose: split remove and free operations in rose_remove_neigh()
[ Upstream commit dcb34659028f856c423a29ef9b4e2571d203444d ] The current rose_remove_neigh() performs two distinct operations: 1. Removes rose_neigh from rose_neigh_list 2. Frees the rose_neigh structure Split these operations into separate functions to improve maintainability and prepare for upcoming refcount_t conversion. The timer cleanup remains in rose_remove_neigh() because free operations can be called from timer itself. This patch introduce rose_neigh_put() to handle the freeing of rose_neigh structures and modify rose_remove_neigh() to handle removal only. Signed-off-by: Takamitsu Iwai <takamitz@amazon.co.jp> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20250823085857.47674-2-takamitz@amazon.co.jp Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: d860d1faa6b2 ("net: rose: convert 'use' field to refcount_t") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/rose.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/rose.h b/include/net/rose.h
index 23267b4efcfa..174b4f605d84 100644
--- a/include/net/rose.h
+++ b/include/net/rose.h
@@ -151,6 +151,14 @@ struct rose_sock {
#define rose_sk(sk) ((struct rose_sock *)(sk))
+static inline void rose_neigh_put(struct rose_neigh *rose_neigh)
+{
+ if (rose_neigh->ax25)
+ ax25_cb_put(rose_neigh->ax25);
+ kfree(rose_neigh->digipeat);
+ kfree(rose_neigh);
+}
+
/* af_rose.c */
extern ax25_address rose_callsign;
extern int sysctl_rose_restart_request_timeout;