Attention is currently required from: Hung-Te Lin, Xi Chen, Paul Menzel, Julius Werner, Xixi Chen.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/61334 )
Change subject: soc/mediatek: Save dram info to cbmem
......................................................................
Patch Set 25: -Code-Review
(1 comment)
File src/soc/mediatek/common/memory.c:
https://review.coreboot.org/c/coreboot/+/61334/comment/49daee2c_42fc3564
PS22, Line 123: p = (void *)((uintptr_t)mc + sizeof(*mc));
The problem with C99 variable-length arrays is that they make sizeof() illegal. […]
Now I see what the problem is. The error will happen only if x (in Julius' example) points to a global variable, which makes perfect sense since the x->c[2] will definitely access invalid memory. However, I don't know why there won't be errors when x points to a local variable.
In PS18 'p' is pointing to a global variable 'curr_dram_info', which is of course wrong. Now in PS25 we've fixed the problem, so I believe we can access the array by `mc->channel[i]`.
--
To view, visit
https://review.coreboot.org/c/coreboot/+/61334
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I195187c0c757a43bb6d2c57c8f303249f2a7995a
Gerrit-Change-Number: 61334
Gerrit-PatchSet: 25
Gerrit-Owner: Xixi Chen
xixi.chen@mediatek.corp-partner.google.com
Gerrit-Reviewer: Hung-Te Lin
hungte@chromium.org
Gerrit-Reviewer: Xi Chen
xixi.chen@mediatek.com
Gerrit-Reviewer: Yu-Ping Wu
yupingso@google.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Julius Werner
jwerner@chromium.org
Gerrit-CC: Paul Menzel
paulepanter@mailbox.org
Gerrit-CC: Rex-BC Chen
rex-bc.chen@mediatek.com
Gerrit-Attention: Hung-Te Lin
hungte@chromium.org
Gerrit-Attention: Xi Chen
xixi.chen@mediatek.com
Gerrit-Attention: Paul Menzel
paulepanter@mailbox.org
Gerrit-Attention: Julius Werner
jwerner@chromium.org
Gerrit-Attention: Xixi Chen
xixi.chen@mediatek.corp-partner.google.com
Gerrit-Comment-Date: Fri, 18 Mar 2022 07:17:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Hung-Te Lin
hungte@chromium.org
Comment-In-Reply-To: Julius Werner
jwerner@chromium.org
Comment-In-Reply-To: Xixi Chen
xixi.chen@mediatek.corp-partner.google.com
Comment-In-Reply-To: Yu-Ping Wu
yupingso@google.com
Gerrit-MessageType: comment