[PATCH] ASoC: sti: initialize player IRQ lock before requesting IRQ
From: Runyu Xiao
Date: Sun Aug 30 2026 - 00:16:11 EST
uni_player_init() registers the shared IRQ before initializing
player->irq_lock. A pending interrupt can invoke the handler while
the lock is still uninitialized.
Initialize the IRQ lock before registering the handler so the interrupt
path always sees valid lock state.
Fixes: d05d862ead8e ("ASoC: STI: Fix null ptr deference in IRQ handler")
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: Codex:GPT-5
Signed-off-by: Runyu Xiao <runyu.xiao@xxxxxxxxxx>
---
sound/soc/sti/uniperif_player.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sti/uniperif_player.c b/sound/soc/sti/uniperif_player.c
index e4b9799ad..3537dd209 100644
--- a/sound/soc/sti/uniperif_player.c
+++ b/sound/soc/sti/uniperif_player.c
@@ -1095,6 +1095,8 @@ int uni_player_init(struct platform_device *pdev,
}
}
+ spin_lock_init(&player->irq_lock);
+
ret = devm_request_irq(&pdev->dev, player->irq,
uni_player_irq_handler, IRQF_SHARED,
dev_name(&pdev->dev), player);
@@ -1104,8 +1106,6 @@ int uni_player_init(struct platform_device *pdev,
}
mutex_init(&player->ctrl_lock);
- spin_lock_init(&player->irq_lock);
-
/* Ensure that disabled by default */
SET_UNIPERIF_CONFIG_BACK_STALL_REQ_DISABLE(player);
SET_UNIPERIF_CTRL_ROUNDING_OFF(player);
--
2.34.1