Re: [PATCH] ALSA: mixart: Don't touch the mailbox when the BAR mapping failed
From: Takashi Iwai
Date: Tue Nov 24 2026 - 07:47:06 EST
On Tue, 24 Nov 2026 05:47:07 +0100,
Suyuan Wang via B4 Relay wrote:
>
> From: Suyuan Wang <stevewong@xxxxxxxxxxx>
>
> snd_mixart_probe() calls snd_mixart_free() when pci_ioremap_bar() fails
> for either BAR. snd_mixart_free() then unconditionally calls
>
> snd_mixart_exit_mailbox(mgr);
>
> which masks the outbound mailbox interrupts by writing to
> MIXART_REG(mgr, MIXART_PCI_OMIMR_OFFSET), i.e. through mgr->mem[1].virt.
> mem[1].virt is still NULL if either BAR mapping fails, so the error
> path oopses on a write near address 0 instead of returning -EBUSY.
>
> Only call snd_mixart_exit_mailbox() when the register BAR is mapped. The
> rest of snd_mixart_free() already copes with a partly set up manager:
> iounmap() accepts NULL, and the IRQ and DMA buffers are checked before
> release.
>
> Found with a static analysis tool and checked by hand.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@xxxxxxxxxxxxxxx
> Co-developed-by: Kaixuan Li <kaixuan.li@xxxxxxxxxx>
> Signed-off-by: Kaixuan Li <kaixuan.li@xxxxxxxxxx>
> Signed-off-by: Suyuan Wang <stevewong@xxxxxxxxxxx>
Applied to for-next branch. Thanks.
Takashi