Skip to content

Commit 11f74f4

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: avs: Fix uninitialized pointer error in probe()
If pcim_request_all_regions() fails, error path operates on uninitialized 'bus' pointer. Found out by Coverity static analyzer. Reviewed-by: Amadeusz Sławiński <[email protected]> Signed-off-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8d452ac commit 11f74f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/soc/intel/avs/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
445445
adev = devm_kzalloc(dev, sizeof(*adev), GFP_KERNEL);
446446
if (!adev)
447447
return -ENOMEM;
448+
bus = &adev->base.core;
449+
448450
ret = avs_bus_init(adev, pci, id);
449451
if (ret < 0) {
450452
dev_err(dev, "failed to init avs bus: %d\n", ret);
@@ -455,7 +457,6 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
455457
if (ret < 0)
456458
return ret;
457459

458-
bus = &adev->base.core;
459460
bus->addr = pci_resource_start(pci, 0);
460461
bus->remap_addr = pci_ioremap_bar(pci, 0);
461462
if (!bus->remap_addr) {

0 commit comments

Comments
 (0)