Thread (6 messages) 6 messages, 2 authors, 2025-08-21

Re: Re: [PATCH v1 net 2/3] net: rose: convert 'use' field to refcount_t

From: Takamitsu Iwai <hidden>
Date: 2025-08-21 03:33:28
Also in: linux-hams

On 2025/08/21, 11:38, "Kuniyuki Iwashima" <kuniyu@google.com <mailto:kuniyu@google.com>> wrote:
From: Takamitsu Iwai <takamitz@amazon.co.jp <mailto:takamitz@amazon.co.jp>>
Date: Thu, 21 Aug 2025 02:47:06 +0900
quoted
@@ -874,8 +874,6 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
rose->state = ROSE_STATE_1;

- rose->neighbour->use++;
-

This is replaced by rose_neigh_hold() in rose_get_neigh(),
then rose_neigh_put() needs to be placed in error paths in
rose_connect() (and rose_route_frame()).
Thank you for reviewing my patch.

You are right and I have also confirmed that we need to place
rose_neigh_put in error paths to prevent reference count leaks.
I will check error paths and resubmit the updated patch.
quoted
rose_write_internal(sk, ROSE_CALL_REQUEST);
rose_start_heartbeat(sk);
rose_start_t1timer(sk);
[...]
quoted
@@ -680,6 +679,7 @@ struct rose_neigh *rose_get_neigh(rose_address *addr, unsigned char *cause,
for (i = 0; i < node->count; i++) {
if (node->neighbour[i]->restarted) {
res = node->neighbour[i];
+ rose_neigh_hold(node->neighbour[i]);
goto out;
}
}
Sincerely
Takamitsu.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help