Skip to content

Commit 0589246

Browse files
cujomalaineybroonie
authored andcommitted
ASoC: Intel: sof_cirrus_common: Guard against missing buses
Even if we find a acpi device we can still be missing the physical node. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20230419195524.46995-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 09cda70 commit 0589246

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sound/soc/intel/boards/sof_cirrus_common.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,16 @@ static int cs35l41_compute_codec_conf(void)
168168
continue;
169169
}
170170
physdev = get_device(acpi_get_first_physical_node(adev));
171+
acpi_dev_put(adev);
172+
if (!physdev) {
173+
pr_devel("Cannot find physical node for HID %s UID %u (%s)\n", CS35L41_HID,
174+
uid, cs35l41_name_prefixes[uid]);
175+
return 0;
176+
}
171177
cs35l41_components[sz].name = dev_name(physdev);
172178
cs35l41_components[sz].dai_name = CS35L41_CODEC_DAI;
173179
cs35l41_codec_conf[sz].dlc.name = dev_name(physdev);
174180
cs35l41_codec_conf[sz].name_prefix = cs35l41_name_prefixes[uid];
175-
acpi_dev_put(adev);
176181
sz++;
177182
}
178183

0 commit comments

Comments
 (0)