diff options
| author | Igor Putko <igorpetindev@gmail.com> | 2026-07-10 18:01:13 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-17 14:18:08 +0200 |
| commit | 33da57cc4a3a6f0c4accc3ec6ca26314efd1700b (patch) | |
| tree | 6132626a2e8d9d404ece2ab9b66eb6792a844449 /drivers | |
| parent | 6a755a616dd4dd1c10f58db2fd5a2475da8c2c9f (diff) | |
staging: nvec: nvec_power: use GFP_KERNEL in probe()
nvec_power_probe() calls devm_kzalloc() with GFP_NOWAIT, which
disables direct reclaim and is meant for atomic context. probe()
runs in normal process context and may sleep, so this needlessly
risks a spurious -ENOMEM under memory pressure instead of just
waiting for reclaim like every other probe() allocation does.
nvec.c's own tegra_nvec_probe() already uses GFP_KERNEL for the
identical pattern, confirming this is an oversight, not intentional.
Signed-off-by: Igor Putko <igorpetindev@gmail.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Link: https://patch.msgid.link/20260710150113.3041-1-igorpetindev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/staging/nvec/nvec_power.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/nvec/nvec_power.c b/drivers/staging/nvec/nvec_power.c index 2faab9fdedef..c514d51a9e57 100644 --- a/drivers/staging/nvec/nvec_power.c +++ b/drivers/staging/nvec/nvec_power.c @@ -377,7 +377,7 @@ static int nvec_power_probe(struct platform_device *pdev) struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent); struct power_supply_config psy_cfg = {}; - power = devm_kzalloc(&pdev->dev, sizeof(struct nvec_power), GFP_NOWAIT); + power = devm_kzalloc(&pdev->dev, sizeof(struct nvec_power), GFP_KERNEL); if (!power) return -ENOMEM; |
