[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250821033317.68056-1-takamitz@amazon.co.jp>
Date: Thu, 21 Aug 2025 12:33:17 +0900
From: Takamitsu Iwai <takamitz@...zon.co.jp>
To: <kuniyu@...gle.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <enjuk@...zon.com>,
<horms@...nel.org>, <kuba@...nel.org>, <linux-hams@...r.kernel.org>,
<mingo@...nel.org>, <netdev@...r.kernel.org>, <pabeni@...hat.com>,
<takamitz@...zon.co.jp>, <tglx@...utronix.de>
Subject: Re: Re: [PATCH v1 net 2/3] net: rose: convert 'use' field to refcount_t
> On 2025/08/21, 11:38, "Kuniyuki Iwashima" <kuniyu@...gle.com <mailto:kuniyu@...gle.com>> wrote:
> From: Takamitsu Iwai <takamitz@...zon.co.jp <mailto:takamitz@...zon.co.jp>>
> Date: Thu, 21 Aug 2025 02:47:06 +0900
> > @@ -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.
> > rose_write_internal(sk, ROSE_CALL_REQUEST);
> > rose_start_heartbeat(sk);
> > rose_start_t1timer(sk);
> [...]
> > @@ -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.
Powered by blists - more mailing lists