[PATCH 2/6][SRU][M] ALSA: hda: cs35l41: Fix the loop check in cs35l41_add_dsd_properties

Chris Chiu chris.chiu at canonical.com
Tue Nov 21 12:28:29 UTC 2023


From: Takashi Iwai <tiwai at suse.de>

BugLink: https://bugs.launchpad.net/bugs/2039151

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")
Reported-by: kernel test robot <lkp at intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308160506.8lCEeFDG-lkp@intel.com/
Link: https://lore.kernel.org/r/20230816063525.23009-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai at suse.de>
(cherry picked from commit 409896794380c1dc0d596bbb9255e583a94d9a00)
Signed-off-by: Chris Chiu <chris.chiu at canonical.com>
---
 sound/pci/hda/cs35l41_hda_property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c
index 673f23257a09..48dcc3f1ef88 100644
--- a/sound/pci/hda/cs35l41_hda_property.c
+++ b/sound/pci/hda/cs35l41_hda_property.c
@@ -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 &&
-- 
2.34.1




More information about the kernel-team mailing list