]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: SOF: amd: add missing platform_device_unregister in acp_pci_rn_probe
authorZheng Bin <zhengbin13@huawei.com>
Thu, 12 May 2022 01:37:28 +0000 (09:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:29:42 +0000 (10:29 +0200)
[ Upstream commit cbcab8cd737c74c20195c31d647e19f7cb49c9b8 ]

acp_pci_rn_probe misses a call platform_device_unregister in error path,
this patch fixes that.

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/20220512013728.4128903-1-zhengbin13@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/sof/amd/pci-rn.c

index 392ffbdf64179a139a4eb38514aa98c0ecef7881..d809d151a38c448a36fe027271a1e2e3c8f0a09e 100644 (file)
@@ -93,6 +93,7 @@ static int acp_pci_rn_probe(struct pci_dev *pci, const struct pci_device_id *pci
        res = devm_kzalloc(&pci->dev, sizeof(struct resource) * ARRAY_SIZE(renoir_res), GFP_KERNEL);
        if (!res) {
                sof_pci_remove(pci);
+               platform_device_unregister(dmic_dev);
                return -ENOMEM;
        }