]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: ymfpci: Fix the missing snd_card_free() call at probe error
authorTakashi Iwai <tiwai@suse.de>
Wed, 23 Aug 2023 16:16:25 +0000 (18:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2023 14:18:16 +0000 (16:18 +0200)
commit440c10034b4ddde55e5c88aa4bf37102ebd0a35e
treef8c8d09b85f3d33f00e2739dc466927fddfc45a9
parent5cc7d81cf57618e24b6db2bc45430bd7249f810d
ALSA: ymfpci: Fix the missing snd_card_free() call at probe error

commit 1d0eb6143c1e85d3f9a3f5a616ee7e5dc351d33b upstream.

Like a few other drivers, YMFPCI driver needs to clean up with
snd_card_free() call at an error path of the probe; otherwise the
other devres resources are released before the card and it results in
the UAF.

This patch uses the helper for handling the probe error gracefully.

Fixes: f33fc1576757 ("ALSA: ymfpci: Create card with device-managed snd_devm_card_new()")
Cc: <stable@vger.kernel.org>
Reported-and-tested-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Closes: https://lore.kernel.org/r/20230823135846.1812-1-takashi.yano@nifty.ne.jp
Link: https://lore.kernel.org/r/20230823161625.5807-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/ymfpci/ymfpci.c