* [U-Boot] [PATCH] spmi: Fix sandbox spmi driver memory corruption
@ 2016-04-04 17:55 Mateusz Kulikowski
2016-04-04 18:06 ` Stephen Warren
2016-04-12 2:29 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Mateusz Kulikowski @ 2016-04-04 17:55 UTC (permalink / raw)
To: u-boot
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>
---
drivers/spmi/spmi-sandbox.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/spmi/spmi-sandbox.c b/drivers/spmi/spmi-sandbox.c
index 2f0fea0..980aff2 100644
--- a/drivers/spmi/spmi-sandbox.c
+++ b/drivers/spmi/spmi-sandbox.c
@@ -35,7 +35,8 @@ struct sandbox_emul_fake_regs {
};
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 {
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] spmi: Fix sandbox spmi driver memory corruption
2016-04-04 17:55 [U-Boot] [PATCH] spmi: Fix sandbox spmi driver memory corruption Mateusz Kulikowski
@ 2016-04-04 18:06 ` Stephen Warren
2016-04-12 2:29 ` [U-Boot] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2016-04-04 18:06 UTC (permalink / raw)
To: u-boot
On 04/04/2016 11:55 AM, Mateusz Kulikowski wrote:
> 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).
Tested-by: Stephen Warren <swarren@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] spmi: Fix sandbox spmi driver memory corruption
2016-04-04 17:55 [U-Boot] [PATCH] spmi: Fix sandbox spmi driver memory corruption Mateusz Kulikowski
2016-04-04 18:06 ` Stephen Warren
@ 2016-04-12 2:29 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2016-04-12 2:29 UTC (permalink / raw)
To: u-boot
On Mon, Apr 04, 2016 at 07:55:58PM +0200, Mateusz Kulikowski wrote:
> 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>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160411/550561e8/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-12 2:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-04 17:55 [U-Boot] [PATCH] spmi: Fix sandbox spmi driver memory corruption Mateusz Kulikowski
2016-04-04 18:06 ` Stephen Warren
2016-04-12 2:29 ` [U-Boot] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox