[U-Boot,v2,8/8] sandbox: swap_case: Increase number of base address regs

Message ID 20180612060502.196817-9-sjg@chromium.org
State Under Review
Delegated to: Tom Rini
Headers show
Series
  • Fix some coverity warnings
Related show

Commit Message

Simon Glass June 12, 2018, 6:05 a.m.
At present the code overruns the bar[] array. Fix this.

At the same time, drop the leading / from the "/spl" path so that we can
run U-Boot SPL with:

   spl/u-boot-spl

rather than requiring:

   /path/to/spl/u-boot-spl

Reported-by: Coverity (CID: 131199)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---

Changes in v2: None

 drivers/misc/swap_case.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini June 19, 2018, 6:42 p.m. | #1
On Tue, Jun 12, 2018 at 12:05:02AM -0600, Simon Glass wrote:

> At present the code overruns the bar[] array. Fix this.
> 
> At the same time, drop the leading / from the "/spl" path so that we can
> run U-Boot SPL with:
> 
>    spl/u-boot-spl
> 
> rather than requiring:
> 
>    /path/to/spl/u-boot-spl
> 
> Reported-by: Coverity (CID: 131199)
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied to u-boot/master, thanks!

Patch

diff --git a/drivers/misc/swap_case.c b/drivers/misc/swap_case.c
index 56cd0700fa..b777404c09 100644
--- a/drivers/misc/swap_case.c
+++ b/drivers/misc/swap_case.c
@@ -21,7 +21,7 @@ 
  */
 struct swap_case_platdata {
 	u16 command;
-	u32 bar[2];
+	u32 bar[6];
 };
 
 #define offset_to_barnum(offset)	\