Skip to content

Commit 23306d2

Browse files
ujfalusiplbossart
authored andcommitted
ASoC: SOF: Intel: Do not (wrongly) assume positive return value in IMR path
The cl_dsp_init() returns 0 on success or negative errno on error. Replace the 'if (ret >= 0)' checks with correct 'if (!ret)` to check for success. Fixes: 2a68ff8 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 4c78c8b commit 23306d2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sound/soc/sof/intel/hda-loader.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static int hda_dsp_boot_imr(struct snd_sof_dev *sdev)
372372
int ret;
373373

374374
ret = cl_dsp_init(sdev, 0, true);
375-
if (ret >= 0)
375+
if (!ret)
376376
hda_sdw_process_wakeen(sdev);
377377

378378
return ret;
@@ -393,8 +393,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
393393
dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n");
394394
hda->boot_iteration = 0;
395395
ret = hda_dsp_boot_imr(sdev);
396-
if (ret >= 0)
397-
return ret;
396+
if (!ret)
397+
return 0;
398398

399399
dev_warn(sdev->dev, "IMR restore failed, trying to cold boot\n");
400400
}

0 commit comments

Comments
 (0)