[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250209201752.66313-1-s0ldw3ll@gmail.com>
Date: Sun, 9 Feb 2025 21:16:48 +0100
From: Dima Volkovsk <s0ldw3ll@...il.com>
To: marvin24@....de,
gregkh@...uxfoundation.org,
ac100@...ts.launchpad.net,
linux-tegra@...r.kernel.org,
linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Cc: Dima Volkovsk <s0ldw3ll@...il.com>
Subject: [PATCH] Staging: nvec: Fix pm_power_off reset condition in tegra_nvec_remove
In the current implementation of tegra_nvec_remove, the pm_power_off handler
is set to NULL without checking if it is actually set to nvec_power_off. This
change ensures that pm_power_off is only reset if it was previously set to
nvec_power_off, preventing unintended side effects when removing the device.
Signed-off-by: Dima Volkovsk <s0ldw3ll@...il.com>
---
drivers/staging/nvec/nvec.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 263774e6a78c..9057f061e927 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -903,8 +903,10 @@ static void tegra_nvec_remove(struct platform_device *pdev)
nvec_unregister_notifier(nvec, &nvec->nvec_status_notifier);
cancel_work_sync(&nvec->rx_work);
cancel_work_sync(&nvec->tx_work);
- /* FIXME: needs check whether nvec is responsible for power off */
- pm_power_off = NULL;
+
+ /* only reset pm_power_off if it's our handler */
+ if (pm_power_off = nvec_power_off)
+ pm_power_off = NULL;
}
#ifdef CONFIG_PM_SLEEP
--
2.48.1
Powered by blists - more mailing lists