mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
ASoC: sdw_utils: Fix potential NULL pointer deref in is_sdca_endpoint_present()
Check the return value of kzalloc() and exit early to avoid a potential
NULL pointer dereference.
Cc: stable@vger.kernel.org
Fixes: 4f8ef33dd4 ("ASoC: soc_sdw_utils: skip the endpoint that doesn't present")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250610103225.1475-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
a4e469c1e2
commit
6325766d69
|
|
@ -1205,6 +1205,8 @@ static int is_sdca_endpoint_present(struct device *dev,
|
|||
int i;
|
||||
|
||||
dlc = kzalloc(sizeof(*dlc), GFP_KERNEL);
|
||||
if (!dlc)
|
||||
return -ENOMEM;
|
||||
|
||||
adr_end = &adr_dev->endpoints[end_index];
|
||||
dai_info = &codec_info->dais[adr_end->num];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user