mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
peci: npcm: Initialize state before requesting IRQ
The PECI interrupt handler uses the lock and completion object as soon as
the interrupt is delivered. Initialize both before registering the
handler so an early interrupt cannot access uninitialized state.
Fixes: 3e16184a1b ("peci: Add peci-npcm controller driver")
Cc: stable@vger.kernel.org
Assisted-by: Codex:GPT-5
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com>
Link: https://lore.kernel.org/r/20260902152256.3591658-1-runyu.xiao@seu.edu.cn
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
This commit is contained in:
parent
61cf765b65
commit
425125e6d4
|
|
@ -253,14 +253,14 @@ static int npcm_peci_probe(struct platform_device *pdev)
|
|||
if (priv->irq < 0)
|
||||
return priv->irq;
|
||||
|
||||
init_completion(&priv->xfer_complete);
|
||||
spin_lock_init(&priv->lock);
|
||||
|
||||
ret = devm_request_irq(&pdev->dev, priv->irq, npcm_peci_irq_handler,
|
||||
0, "peci-npcm-irq", priv);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
init_completion(&priv->xfer_complete);
|
||||
spin_lock_init(&priv->lock);
|
||||
|
||||
ret = npcm_peci_init_ctrl(priv);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user