Re: [PATCH v2] ALSA: hda: Check snd_hda_power_pm construct error before executing verb

From: Takashi Iwai

Date: Wed Jul 22 2026 - 07:30:59 EST


On Fri, 17 Jul 2026 04:49:48 +0200,
songxiebing wrote:
>
> From: Bob Song <songxiebing@xxxxxxxxxx>
>
> When userspace writes 1 to /sys/bus/pci/devices/XX/remove to remove HDA PCI device,
> the HDA hardware control path is shut down and devres unmaps the BAR virtual address
> bus->remap_addr automatically during driver removal.
>
> If a delayed HDA verb command arrives after the MMIO region is unmapped, the driver
> will access invalid virtual addresses and trigger a page fault splat.
>
> So add an error check right after constructing snd_hda_power_pm:
>
> Signed-off-by: Bob Song <songxiebing@xxxxxxxxxx>
> ---
> Changes in v2:
> - Modify the judgment from pm_runtime_datus_stuspended to bus->core.chip_init

Applied to for-next branch. Thanks.


Takashi