John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39261 )
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
soc/intel/tigerlake: Avoid NULL pointer dereference
Coverity detects pointer dev as FORWARD_NULL. Add sanity check for dev to prevent NULL pointer dereference.
BUG=CID 1420208 TEST=Built image successfully.
Change-Id: I2a62da44c7044f9dc281eae0949f7f7b612ab238 Signed-off-by: John Zhao john.zhao@intel.com --- M src/soc/intel/tigerlake/romstage/fsp_params_jsl.c 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/39261/1
diff --git a/src/soc/intel/tigerlake/romstage/fsp_params_jsl.c b/src/soc/intel/tigerlake/romstage/fsp_params_jsl.c index 56124f4..09b06f1 100644 --- a/src/soc/intel/tigerlake/romstage/fsp_params_jsl.c +++ b/src/soc/intel/tigerlake/romstage/fsp_params_jsl.c @@ -95,7 +95,10 @@ m_cfg->DdiPortCDdc = config->DdiPortCDdc;
/* Audio */ - m_cfg->PchHdaEnable = pcidev_path_on_root(PCH_DEVFN_HDA) ? dev->enabled : 0; + if (dev) { + m_cfg->PchHdaEnable = pcidev_path_on_root(PCH_DEVFN_HDA) ? dev->enable + : 0; + }
m_cfg->PchHdaDspEnable = config->PchHdaDspEnable; m_cfg->PchHdaAudioLinkHdaEnable = config->PchHdaAudioLinkHdaEnable;
Hello build bot (Jenkins), Martin Roth, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39261
to look at the new patch set (#2).
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
soc/intel/tigerlake: Avoid NULL pointer dereference
Coverity detects pointer dev as FORWARD_NULL. Add sanity check for dev to prevent NULL pointer dereference.
BUG=CID 1420208 TEST=Built image successfully.
Change-Id: I2a62da44c7044f9dc281eae0949f7f7b612ab238 Signed-off-by: John Zhao john.zhao@intel.com --- M src/soc/intel/tigerlake/romstage/fsp_params_jsl.c 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/39261/2
Hello build bot (Jenkins), Martin Roth, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39261
to look at the new patch set (#3).
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
soc/intel/tigerlake: Avoid NULL pointer dereference
Coverity detects pointer dev as FORWARD_NULL. Add sanity check for dev to prevent NULL pointer dereference.
BUG=CID 1420208 TEST=Built image successfully.
Change-Id: I2a62da44c7044f9dc281eae0949f7f7b612ab238 Signed-off-by: John Zhao john.zhao@intel.com --- M src/soc/intel/tigerlake/romstage/fsp_params_jsl.c 1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/39261/3
Hello build bot (Jenkins), Martin Roth, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39261
to look at the new patch set (#4).
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
soc/intel/tigerlake: Avoid NULL pointer dereference
Coverity detects pointer dev as FORWARD_NULL. Add sanity check for dev to prevent NULL pointer dereference.
BUG=CID 1420208 TEST=Built image successfully.
Change-Id: I2a62da44c7044f9dc281eae0949f7f7b612ab238 Signed-off-by: John Zhao john.zhao@intel.com --- M src/soc/intel/tigerlake/romstage/fsp_params_jsl.c 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/39261/4
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39261 )
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
Patch Set 4:
(1 comment)
Is this a duplicate of
https://review.coreboot.org/c/coreboot/+/39261/2/src/soc/intel/tigerlake/rom... File src/soc/intel/tigerlake/romstage/fsp_params_jsl.c:
https://review.coreboot.org/c/coreboot/+/39261/2/src/soc/intel/tigerlake/rom... PS2, Line 98: dev What is this supposed to be? The IGD?
Hello build bot (Jenkins), Martin Roth, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39261
to look at the new patch set (#5).
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
soc/intel/tigerlake: Avoid NULL pointer dereference
Coverity detects pointer dev as FORWARD_NULL. Add sanity check for dev to prevent NULL pointer dereference.
BUG=CID 1420208 TEST=Built image successfully.
Change-Id: I2a62da44c7044f9dc281eae0949f7f7b612ab238 Signed-off-by: John Zhao john.zhao@intel.com --- M src/soc/intel/tigerlake/romstage/fsp_params_jsl.c 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/39261/5
John Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39261 )
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39261/2/src/soc/intel/tigerlake/rom... File src/soc/intel/tigerlake/romstage/fsp_params_jsl.c:
https://review.coreboot.org/c/coreboot/+/39261/2/src/soc/intel/tigerlake/rom... PS2, Line 98: dev
What is this supposed to be? The IGD?
Thanks for pointing the mistake. dev should be HDA instead of IGD.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39261 )
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
Patch Set 5: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/39261/5//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39261/5//COMMIT_MSG@9 PS5, Line 9: Coverity detects pointer dev as FORWARD_NULL. Add sanity check Maybe add that "dev" did not point to the audio device.
Hello build bot (Jenkins), Martin Roth, Angel Pons, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39261
to look at the new patch set (#6).
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
soc/intel/tigerlake: Avoid NULL pointer dereference
Coverity detects pointer dev as FORWARD_NULL. Add sanity check for dev to prevent NULL pointer dereference if dev did not point to the audio device.
BUG=CID 1420208 TEST=Built image successfully.
Change-Id: I2a62da44c7044f9dc281eae0949f7f7b612ab238 Signed-off-by: John Zhao john.zhao@intel.com --- M src/soc/intel/tigerlake/romstage/fsp_params_jsl.c 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/39261/6
John Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39261 )
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39261/5//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39261/5//COMMIT_MSG@9 PS5, Line 9: Coverity detects pointer dev as FORWARD_NULL. Add sanity check
Maybe add that "dev" did not point to the audio device.
Ack
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39261 )
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
soc/intel/tigerlake: Avoid NULL pointer dereference
Coverity detects pointer dev as FORWARD_NULL. Add sanity check for dev to prevent NULL pointer dereference if dev did not point to the audio device.
BUG=CID 1420208 TEST=Built image successfully.
Change-Id: I2a62da44c7044f9dc281eae0949f7f7b612ab238 Signed-off-by: John Zhao john.zhao@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/39261 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/soc/intel/tigerlake/romstage/fsp_params_jsl.c 1 file changed, 5 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/soc/intel/tigerlake/romstage/fsp_params_jsl.c b/src/soc/intel/tigerlake/romstage/fsp_params_jsl.c index 56124f4..9c70f2e 100644 --- a/src/soc/intel/tigerlake/romstage/fsp_params_jsl.c +++ b/src/soc/intel/tigerlake/romstage/fsp_params_jsl.c @@ -95,7 +95,11 @@ m_cfg->DdiPortCDdc = config->DdiPortCDdc;
/* Audio */ - m_cfg->PchHdaEnable = pcidev_path_on_root(PCH_DEVFN_HDA) ? dev->enabled : 0; + dev = pcidev_path_on_root(PCH_DEVFN_HDA); + if (!dev) + m_cfg->PchHdaEnable = 0; + else + m_cfg->PchHdaEnable = dev->enabled;
m_cfg->PchHdaDspEnable = config->PchHdaDspEnable; m_cfg->PchHdaAudioLinkHdaEnable = config->PchHdaAudioLinkHdaEnable;
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39261 )
Change subject: soc/intel/tigerlake: Avoid NULL pointer dereference ......................................................................
Patch Set 7:
Automatic boot test returned (PASS/FAIL/TOTAL): 3/0/3 Emulation targets: EMULATION_QEMU_X86_Q35 using payload TianoCore : SUCCESS : https://lava.9esec.io/r/1194 EMULATION_QEMU_X86_Q35 using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/1193 EMULATION_QEMU_X86_I440FX using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/1192
Please note: This test is under development and might not be accurate at all!