Re: [PATCH v2 1/4] leds: trigger: netdev: Put netdev on activate error path
From: Andrew Lunn
Date: Sun Sep 27 2026 - 11:08:23 EST
On Mon, Sep 21, 2026 at 11:32:43AM +0200, A. Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxxxx>
>
> When hw control is active, set_device_name() takes a reference on the
> netdev via dev_get_by_name(). The register_netdevice_notifier() failure
> path frees trigger_data without dropping it, leaking the netdev.
Maybe it would be better to add a unset_device_name(), which releases
the reference, and does anything else which needs to be undone?
Andrew