Re: [PATCH v2 2/2] staging: nvec: fix unconditional pm_power_off teardown
From: Dan Carpenter
Date: Tue Apr 14 2026 - 01:56:29 EST
On Mon, Apr 13, 2026 at 05:12:36PM +0200, Alexandru Hossu wrote:
> tegra_nvec_remove() unconditionally sets pm_power_off = NULL, even if
> nvec was not the one that registered it. This breaks any other driver
> that may have set pm_power_off to its own handler.
>
> Replace the unconditional assignment with a guarded check so that
> pm_power_off is only cleared if nvec was the one that set it.
>
> Also remove the stale FIXME comment, as the guard addresses exactly
> what it was asking for.
>
> Fixes: 3f8d52ba1c49 ("staging: nvec: Remove nvec_power module")
> Signed-off-by: Alexandru Hossu <hossu.alexandru@xxxxxxxxx>
> ---
> v2:
> - Drop nvec_power_handle = NULL; after pm_power_off = NULL is set,
> nvec_power_off() is unreachable via pm_power_off, so there is no
> dangling-pointer risk there (Dan Carpenter)
Thanks!
Reviewed-by: Dan Carpenter <error27@xxxxxxxxx>
regards,
dan carpenter