Commit 2196ae28 authored by Elinor Montmasson's avatar Elinor Montmasson Committed by Ye Bin
Browse files

ASoC: fsl-asoc-card: set priv->pdev before using it

mainline inclusion
from mainline-v6.10-rc6
commit 90f3feb24172185f1832636264943e8b5e289245
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAGEP3
CVE: CVE-2024-42089

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=90f3feb24172185f1832636264943e8b5e289245



-------------------------------------------

priv->pdev pointer was set after being used in
fsl_asoc_card_audmux_init().
Move this assignment at the start of the probe function, so
sub-functions can correctly use pdev through priv.

fsl_asoc_card_audmux_init() dereferences priv->pdev to get access to the
dev struct, used with dev_err macros.
As priv is zero-initialised, there would be a NULL pointer dereference.
Note that if priv->dev is dereferenced before assignment but never used,
for example if there is no error to be printed, the driver won't crash
probably due to compiler optimisations.

Fixes: 708b4351 ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support")
Signed-off-by: default avatarElinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Link: https://patch.msgid.link/20240620132511.4291-2-elinor.montmasson@savoirfairelinux.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Conflicts:
	sound/soc/fsl/fsl-asoc-card.c
[resolved context change]
Signed-off-by: default avatarYe Bin <yebin10@huawei.com>
parent 4b14a483
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment