Patch "ASoC: amd: Adjust error handling in case of absent codec device" has been added to the 6.6-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

    ASoC: amd: Adjust error handling in case of absent codec device

to the 6.6-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:
     asoc-amd-adjust-error-handling-in-case-of-absent-cod.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 9fa931a122ae4432b56cf6ee423009e8b7e25f9f
Author: Aleksandr Mishin <amishin@xxxxxxxxxx>
Date:   Wed Jul 3 22:10:07 2024 +0300

    ASoC: amd: Adjust error handling in case of absent codec device
    
    [ Upstream commit 5080808c3339de2220c602ab7c7fa23dc6c1a5a3 ]
    
    acpi_get_first_physical_node() can return NULL in several cases (no such
    device, ACPI table error, reference count drop to 0, etc).
    Existing check just emit error message, but doesn't perform return.
    Then this NULL pointer is passed to devm_acpi_dev_add_driver_gpios()
    where it is dereferenced.
    
    Adjust this error handling by adding error code return.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform")
    Signed-off-by: Aleksandr Mishin <amishin@xxxxxxxxxx>
    Link: https://patch.msgid.link/20240703191007.8524-1-amishin@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
index 5e56d3a53be78..49bffc567e68d 100644
--- a/sound/soc/amd/acp-es8336.c
+++ b/sound/soc/amd/acp-es8336.c
@@ -203,8 +203,10 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
 
 	codec_dev = acpi_get_first_physical_node(adev);
 	acpi_dev_put(adev);
-	if (!codec_dev)
+	if (!codec_dev) {
 		dev_err(card->dev, "can not find codec dev\n");
+		return -ENODEV;
+	}
 
 	ret = devm_acpi_dev_add_driver_gpios(codec_dev, acpi_es8336_gpios);
 	if (ret)




[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