mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-30 08:30:50 +09:00
spmi: Fix sandbox spmi driver memory corruption
There is off-by-one error in sandbox_emul_gpio that causes segfault of certain tests. EMUL_GPIO_REG_END is the address of last valid (emulated) register. This patch fixed this (by adding one more element to emulated register array). Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
eed095da30
commit
aafa64827f
@ -35,7 +35,8 @@ struct sandbox_emul_fake_regs {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct sandbox_emul_gpio {
|
struct sandbox_emul_gpio {
|
||||||
struct sandbox_emul_fake_regs r[EMUL_GPIO_REG_END]; /* Fake registers */
|
/* Fake registers - need one more entry as REG_END is valid address. */
|
||||||
|
struct sandbox_emul_fake_regs r[EMUL_GPIO_REG_END + 1];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sandbox_spmi_priv {
|
struct sandbox_spmi_priv {
|
||||||
|
Loading…
Reference in New Issue
Block a user