mirror of
https://github.com/torvalds/linux.git
synced 2026-11-10 17:11:02 +01:00
ASoC: stm: stm32_i2s: request IRQ after regmap initialization
The ISR accesses the managed regmap, but probe requests the IRQ before
creating it. An early interrupt can reach an uninitialized regmap.
Reverse-order cleanup can free the regmap while the IRQ remains active.
Request the IRQ after regmap initialization so probe unwind and
removal free and synchronize it before releasing the regmap.
The teardown ordering issue was found by static analysis.
Fixes: e4e6ec7b12 ("ASoC: stm32: Add I2S driver")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20261004043451.1138613-1-mhun512@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
157f7cba77
commit
1b207c8555
|
|
@ -1197,7 +1197,7 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev,
|
|||
struct device_node *np = pdev->dev.of_node;
|
||||
struct reset_control *rst;
|
||||
struct resource *res;
|
||||
int irq, ret;
|
||||
int ret;
|
||||
|
||||
if (!np)
|
||||
return -ENODEV;
|
||||
|
|
@ -1243,16 +1243,6 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Get irqs */
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, 0,
|
||||
dev_name(&pdev->dev), i2s);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Reset */
|
||||
rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
|
||||
if (IS_ERR(rst))
|
||||
|
|
@ -1277,7 +1267,7 @@ static int stm32_i2s_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct stm32_i2s_data *i2s;
|
||||
u32 val;
|
||||
int ret;
|
||||
int irq, ret;
|
||||
|
||||
i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
|
||||
if (!i2s)
|
||||
|
|
@ -1303,6 +1293,15 @@ static int stm32_i2s_probe(struct platform_device *pdev)
|
|||
return dev_err_probe(&pdev->dev, PTR_ERR(i2s->regmap),
|
||||
"Regmap init error\n");
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, 0,
|
||||
dev_name(&pdev->dev), i2s);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = snd_dmaengine_pcm_register(&pdev->dev, &stm32_i2s_pcm_config, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user