Skip to content

kernel-open: guard nv_audio_dynamic_power against non-HDA drivers - #1404

Open
bodapatisaikrishna wants to merge 1 commit into
NVIDIA:mainfrom
bodapatisaikrishna:fix/nv-audio-dynamic-power-driver-check
Open

bodapatisaikrishna wants to merge 1 commit into
NVIDIA:mainfrom
bodapatisaikrishna:fix/nv-audio-dynamic-power-driver-check

Conversation

@bodapatisaikrishna

Copy link
Copy Markdown

Fixes #1365

nv_audio_dynamic_power() blindly casts the result of pci_get_drvdata(audio_pci_dev) to struct snd_card *. When the audio function is bound to a different driver (e.g. vfio-pci for GPU passthrough), the returned pointer is unrelated driver data and dereferencing it causes a kernel panic.

This adds a check that verifies snd_hda_intel is actually bound before touching the driver data.

nv_audio_dynamic_power() calls pci_get_drvdata() on the GPU audio
function and casts the result to struct snd_card * without checking
the bound driver. When a non-HDA driver like vfio-pci is bound, the
drvdata is not a snd_card, and dereferencing it panics the kernel.

Add a check that the audio PCI device is actually bound to snd_hda_intel
before accessing its driver data.

Fixes: NVIDIA#1365
Signed-off-by: bodapatisaikrishna <saikrishnabodapati@gmail.com>
@CLAassistant

CLAassistant commented Sep 26, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nv_audio_dynamic_power() panics when the audio function is not bound to snd-hda-intel

2 participants