Skip to contentSkip to conversation

ALSA: hda: cs35l41: Fix the loop check in cs35l41_add_dsd_properties

PATCH New Takashi Iwai 1 participant 1 message Aug 16, 2023 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda: cs35l41: Fix the loop check in cs35l41_add_dsd_properties

model->hid is a pointer, and should be rather NULL-checked in the loop of cs35l41_prop_model_table.

Fixes ef4ba63f12b0 ("ALSA: hda: cs35l41: Support systems with missing _DSD properties")
---
 sound/pci/hda/cs35l41_hda_property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/cs35l41_hda_property.c +1 -1
index 673f23257a09..48dcc3f1ef88 100644
@@ -61,7 +61,7 @@ int cs35l41_add_dsd_properties(struct cs35l41_hda *cs35l41, struct device *physd
 {
 	const struct cs35l41_prop_model *model;
 
-	for (model = cs35l41_prop_model_table; model->hid > 0; model++) {
+	for (model = cs35l41_prop_model_table; model->hid; model++) {
 		if (!strcmp(model->hid, hid) &&
 		    (!model->ssid ||
 		     (cs35l41->acpi_subsystem_id &&
Signature · 1 line
2.35.3