Patch "ALSA: hda: Add missing sanity checks in PM prepare/complete callbacks" has been added to the 5.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ALSA: hda: Add missing sanity checks in PM prepare/complete callbacks

to the 5.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     alsa-hda-add-missing-sanity-checks-in-pm-prepare-complete-callbacks.patch
and it can be found in the queue-5.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 66affb7bb0dc0905155a1b2475261aa704d1ddb5 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@xxxxxxx>
Date: Mon, 29 Mar 2021 13:30:59 +0200
Subject: ALSA: hda: Add missing sanity checks in PM prepare/complete callbacks

From: Takashi Iwai <tiwai@xxxxxxx>

commit 66affb7bb0dc0905155a1b2475261aa704d1ddb5 upstream.

The recently added PM prepare and complete callbacks don't have the
sanity check whether the card instance has been properly initialized,
which may potentially lead to Oops.

This patch adds the azx_is_pm_ready() call in each place
appropriately like other PM callbacks.

Fixes: f5dac54d9d93 ("ALSA: hda: Separate runtime and system suspend")
Cc: <stable@xxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20210329113059.25035-2-tiwai@xxxxxxx
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 sound/pci/hda/hda_intel.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1023,6 +1023,9 @@ static int azx_prepare(struct device *de
 	struct snd_card *card = dev_get_drvdata(dev);
 	struct azx *chip;
 
+	if (!azx_is_pm_ready(card))
+		return 0;
+
 	chip = card->private_data;
 	chip->pm_prepared = 1;
 	snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
@@ -1040,6 +1043,9 @@ static void azx_complete(struct device *
 	struct snd_card *card = dev_get_drvdata(dev);
 	struct azx *chip;
 
+	if (!azx_is_pm_ready(card))
+		return;
+
 	chip = card->private_data;
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
 	chip->pm_prepared = 0;


Patches currently in stable-queue which might be from tiwai@xxxxxxx are

queue-5.11/alsa-hda-re-add-dropped-snd_poewr_change_state-calls.patch
queue-5.11/alsa-usb-audio-apply-sample-rate-quirk-to-logitech-connect.patch
queue-5.11/alsa-hda-add-missing-sanity-checks-in-pm-prepare-complete-callbacks.patch
queue-5.11/alsa-hda-realtek-fix-mute-micmute-leds-for-hp-640-g8.patch
queue-5.11/alsa-hda-realtek-fix-a-determine_headset_type-issue-for-a-dell-aio.patch
queue-5.11/alsa-hda-realtek-call-alc_update_headset_mode-in-hp_automute_hook.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux