Re: [PATCH net-next v2 2/2] netconsole: remove unnecessary target refcounting from the netdev notifier

From: Breno Leitao

Date: Thu Oct 15 2026 - 06:28:54 EST


On Mon, Oct 12, 2026 at 06:03:44PM +0100, Gustavo Luiz Duarte wrote:
> Since netconsole_netdev_event() holds target_list_lock, there is no need
> to also protect each target with netconsole_target_get/put()
> refcounting. There is no way a target reachable from the target_list
> would go away while we hold target_list_lock.

Nice. I have never thought about it, but you are correct. The
notifier's get/put never protected nt at all.

> This is similar to commit a6d403ac9689 ("netconsole: remove
> unnecessary netconsole_target_get/out() from write_msg()").
>
> Since this is the only remaining user of netconsole_target_get/put(),
> remove those helpers as well.
>
> Signed-off-by: Gustavo Luiz Duarte <gustavold@xxxxxxxxx> ---

Reviewed-by: Breno Leitao <leitao@xxxxxxxxxx>