mfd: macsmc: Initialize mutex
Janne Grunau
maintainerPATCH v2 1/1 mfd: macsmc: Initialize mutex
Initialize struct apple_smc's mutex in apple_smc_probe(). Using the mutex uninitialized surprisingly resulted only in occasional NULL pointer dereferences in apple_smc_read() calls from the probe() functions of sub devices.
---
Changes in v2:
- rewritten commit message
- added missing Cc: stable
- rebased onto v6.19-rc1
- Link to v1: https://lore.kernel.org/r/[email protected]
--- drivers/mfd/macsmc.c | 1 + 1 file changed, 1 insertion(+)
drivers/mfd/macsmc.c +1 -0
@@ -413,6 +413,7 @@ static int apple_smc_probe(struct platform_device *pdev)if (!smc)return -ENOMEM ; +mutex_init (&smc->mutex); smc->dev = &pdev->dev; smc->sram_base =devm_platform_get_and_ioremap_resource (pdev,1 , &smc->sram);if (IS_ERR (smc->sram_base))
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20250925-macsmc-mutex_init-80d7cb2aacfa
Best regards,
Signature · 1 line
Janne Grunau <[email protected]>
Quoted 8 lines · Janne Grunau
Initialize struct apple_smc's mutex in
apple_smc_probe(). Using the mutex uninitialized surprisingly resulted only in occasional NULL pointer dereferences inapple_smc_read()calls from theprobe()functions of sub devices.Fixes e038d985c9823 ("mfd: Add Apple Silicon System Management Controller")Signed-off-by Janne Grunau <[email protected]>
Quoted 7 lines
---
Changes in v2:
- rewritten commit message
- added missing Cc: stable
- rebased onto v6.19-rc1
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Thanks,
Sven
Re: (subset) [PATCH v2] mfd: macsmc: Initialize mutex
In reply to Janne GrunauQuoted 6 lines · Janne Grunau
Initialize struct apple_smc's mutex in
apple_smc_probe(). Using the mutex uninitialized surprisingly resulted only in occasional NULL pointer dereferences inapple_smc_read()calls from theprobe()functions of sub devices.
Applied, thanks!
[1/1] mfd: macsmc: Initialize mutex
commit: 9f7cd8015f588755ada102d400c58ed1ca28a63d
--
Lee Jones [李琼斯]