Unverified Commit f22ba356 authored by Laurentiu Mihalcea's avatar Laurentiu Mihalcea Committed by Mark Brown
Browse files

ASoC: SOF: imx-common: set sdev->pdata->hw_pdata after common is alloc'd



'imx_unregister_action' uses 'sdev->pdata->hw_pdata' to fetch the pointer
to the common data structure. As such, if 'sdev->pdata->hw_pdata' is not
set before adding 'imx_unregister_action' to the devres list, we risk
derefrencing a NULL pointer if any of the calls between
'devm_add_action_or_reset' and 'sdev->pdata->hw_pdata = common' fails.

Set 'sdev->pdata->hw_pdata' to point to 'common' as soon as 'common' is
allocated.

Fixes: 651e0ed3 (" ASoC: SOF: imx: introduce more common structures and functions")
Signed-off-by: default avatarLaurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Reviewed-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>

Link: https://patch.msgid.link/20250211225018.2642-1-laurentiumihalcea111@gmail.com


Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 21aa330f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment