Skip to content

Commit 6386682

Browse files
simontrimmertiwai
authored andcommitted
ALSA: hda: cs35l41: Possible null pointer dereference in cs35l41_hda_unbind()
The cs35l41_hda_unbind() function clears the hda_component entry matching it's index and then dereferences the codec pointer held in the first element of the hda_component array, this is an issue when the device index was 0. Instead use the codec pointer stashed in the cs35l41_hda structure as it will still be valid. Fixes: 7cf5ce6 ("ALSA: hda: cs35l41: Add device_link between HDA and cs35l41_hda") Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Link: https://lore.kernel.org/r/20240531120820.35367-1-simont@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent d339131 commit 6386682

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/pci/hda/cs35l41_hda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ static void cs35l41_hda_unbind(struct device *dev, struct device *master, void *
14951495
if (comps[cs35l41->index].dev == dev) {
14961496
memset(&comps[cs35l41->index], 0, sizeof(*comps));
14971497
sleep_flags = lock_system_sleep();
1498-
device_link_remove(&comps->codec->core.dev, cs35l41->dev);
1498+
device_link_remove(&cs35l41->codec->core.dev, cs35l41->dev);
14991499
unlock_system_sleep(sleep_flags);
15001500
}
15011501
}

0 commit comments

Comments
 (0)