Skip to content

Commit

Permalink
ASoC: Intel: avs: Check ida before free module
Browse files Browse the repository at this point in the history
Checking if the module ida is empty before releasing the module is needed.
A direct free ida may cause a kernel null pointer exception when the DSP
rebooting failed.

Signed-off-by: Wan, Xinxin <[email protected]>
  • Loading branch information
xinxin-wan authored and JeevakaPrabu committed Jun 18, 2024
1 parent 0b54d1d commit a2e0e29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/intel/avs/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ void avs_module_id_free(struct avs_dev *adev, u16 module_id, u8 instance_id)
goto exit;
}

ida_free(adev->mod_idas[idx], instance_id);
if (!ida_is_empty(adev->mod_idas[idx]))
ida_free(adev->mod_idas[idx], instance_id);
exit:
mutex_unlock(&adev->modres_mutex);
}
Expand Down

0 comments on commit a2e0e29

Please sign in to comment.