All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] km/ivm: fix string len check to support 7 char board names
@ 2012-08-09 11:43 Holger Brunck
  2012-08-14 14:23 ` Holger Brunck
  0 siblings, 1 reply; 5+ messages in thread
From: Holger Brunck @ 2012-08-09 11:43 UTC (permalink / raw)
  To: u-boot

From: Valentin Longchamp <valentin.longchamp@keymile.com>

The fanless boards now have a 7-digit (XXXXX-F) board name. This
triggers a border condition when reading this string in the IVM although
this string is smaller than the currenly read string size, but only by 1
character.

This patch corrects this by changing the size check condition for string
length.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Wolfgang Denk <wd@denx.de>
---
 board/keymile/common/ivm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index 9bc3c21..eaa924f 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -163,7 +163,7 @@ static int ivm_findinventorystring(int type,
 		if (addr == INVENTORYDATASIZE) {
 			xcode = -1;
 			printf("Error end of string not found\n");
-		} else if ((size >= (maxlen - 1)) &&
+		} else if ((size > (maxlen - 1)) &&
 			   (buf[addr] != '\r')) {
 			xcode = -1;
 			printf("string too long till next CR\n");
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] km/ivm: fix string len check to support 7 char board names
@ 2012-08-14 11:16 Valentin Longchamp
  2012-08-14 13:29 ` Prafulla Wadaskar
  2012-09-03  8:46 ` Prafulla Wadaskar
  0 siblings, 2 replies; 5+ messages in thread
From: Valentin Longchamp @ 2012-08-14 11:16 UTC (permalink / raw)
  To: u-boot

The fanless boards now have a 7-digit (XXXXX-F) board name. This
triggers a border condition when reading this string in the IVM although
this string is smaller than the currenly read string size, but only by 1
character.

This patch corrects this by changing the size check condition for string
length. It is the same change that was done in the platform for this
same bug.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
cc: Stefan Bigler <stefan.bigler@keymile.com>
---
 board/keymile/common/ivm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index 9bc3c21..eaa924f 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -163,7 +163,7 @@ static int ivm_findinventorystring(int type,
 		if (addr == INVENTORYDATASIZE) {
 			xcode = -1;
 			printf("Error end of string not found\n");
-		} else if ((size >= (maxlen - 1)) &&
+		} else if ((size > (maxlen - 1)) &&
 			   (buf[addr] != '\r')) {
 			xcode = -1;
 			printf("string too long till next CR\n");
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] km/ivm: fix string len check to support 7 char board names
  2012-08-14 11:16 Valentin Longchamp
@ 2012-08-14 13:29 ` Prafulla Wadaskar
  2012-09-03  8:46 ` Prafulla Wadaskar
  1 sibling, 0 replies; 5+ messages in thread
From: Prafulla Wadaskar @ 2012-08-14 13:29 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: u-boot-bounces at lists.denx.de [mailto:u-boot-
> bounces at lists.denx.de] On Behalf Of Valentin Longchamp
> Sent: 14 August 2012 16:47
> To: u-boot at lists.denx.de
> Cc: Valentin Longchamp; hs at denx.de; Holger Brunck; Stefan Bigler
> Subject: [U-Boot] [PATCH] km/ivm: fix string len check to support 7
> char board names
> 
> The fanless boards now have a 7-digit (XXXXX-F) board name. This
> triggers a border condition when reading this string in the IVM
> although
> this string is smaller than the currenly read string size, but only by
> 1
> character.
> 
> This patch corrects this by changing the size check condition for
> string
> length. It is the same change that was done in the platform for this
> same bug.
> 
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> cc: Holger Brunck <holger.brunck@keymile.com>
> cc: Stefan Bigler <stefan.bigler@keymile.com>
> ---
>  board/keymile/common/ivm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
> index 9bc3c21..eaa924f 100644
> --- a/board/keymile/common/ivm.c
> +++ b/board/keymile/common/ivm.c
> @@ -163,7 +163,7 @@ static int ivm_findinventorystring(int type,
>  		if (addr == INVENTORYDATASIZE) {
>  			xcode = -1;
>  			printf("Error end of string not found\n");
> -		} else if ((size >= (maxlen - 1)) &&
> +		} else if ((size > (maxlen - 1)) &&
>  			   (buf[addr] != '\r')) {
>  			xcode = -1;
>  			printf("string too long till next CR\n");
> --

Acked by: Prafulla Wadaskar <prafulla@marvell.com>
I will pull this patch.

Regards...
Prafulla . . .

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] km/ivm: fix string len check to support 7 char board names
  2012-08-09 11:43 [U-Boot] [PATCH] km/ivm: fix string len check to support 7 char board names Holger Brunck
@ 2012-08-14 14:23 ` Holger Brunck
  0 siblings, 0 replies; 5+ messages in thread
From: Holger Brunck @ 2012-08-14 14:23 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On 08/09/2012 01:43 PM, Holger Brunck wrote:
> From: Valentin Longchamp <valentin.longchamp@keymile.com>
> 
> The fanless boards now have a 7-digit (XXXXX-F) board name. This
> triggers a border condition when reading this string in the IVM although
> this string is smaller than the currenly read string size, but only by 1
> character.
> 
> This patch corrects this by changing the size check condition for string
> length.
> 
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> cc: Wolfgang Denk <wd@denx.de>
> ---
>  board/keymile/common/ivm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 

could you please drop this patch? It was posted twice by accident and the other
(same) patch is running through Prafullas branch.

http://patchwork.ozlabs.org/patch/177225/

Sorry for this.

Regards
Holger Brunck

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] km/ivm: fix string len check to support 7 char board names
  2012-08-14 11:16 Valentin Longchamp
  2012-08-14 13:29 ` Prafulla Wadaskar
@ 2012-09-03  8:46 ` Prafulla Wadaskar
  1 sibling, 0 replies; 5+ messages in thread
From: Prafulla Wadaskar @ 2012-09-03  8:46 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Prafulla Wadaskar
> Sent: 14 August 2012 19:00
> To: 'Valentin Longchamp'; u-boot at lists.denx.de
> Cc: hs at denx.de; Holger Brunck; Stefan Bigler
> Subject: RE: [U-Boot] [PATCH] km/ivm: fix string len check to support
> 7 char board names
> 
> 
> 
> > -----Original Message-----
> > From: u-boot-bounces at lists.denx.de [mailto:u-boot-
> > bounces at lists.denx.de] On Behalf Of Valentin Longchamp
> > Sent: 14 August 2012 16:47
> > To: u-boot at lists.denx.de
> > Cc: Valentin Longchamp; hs at denx.de; Holger Brunck; Stefan Bigler
> > Subject: [U-Boot] [PATCH] km/ivm: fix string len check to support 7
> > char board names
> >
> > The fanless boards now have a 7-digit (XXXXX-F) board name. This
> > triggers a border condition when reading this string in the IVM
> > although
> > this string is smaller than the currenly read string size, but only
> by
> > 1
> > character.
> >
> > This patch corrects this by changing the size check condition for
> > string
> > length. It is the same change that was done in the platform for this
> > same bug.
> >
> > Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> > cc: Holger Brunck <holger.brunck@keymile.com>
> > cc: Stefan Bigler <stefan.bigler@keymile.com>
> > ---
> >  board/keymile/common/ivm.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
> > index 9bc3c21..eaa924f 100644
> > --- a/board/keymile/common/ivm.c
> > +++ b/board/keymile/common/ivm.c
> > @@ -163,7 +163,7 @@ static int ivm_findinventorystring(int type,
> >  		if (addr == INVENTORYDATASIZE) {
> >  			xcode = -1;
> >  			printf("Error end of string not found\n");
> > -		} else if ((size >= (maxlen - 1)) &&
> > +		} else if ((size > (maxlen - 1)) &&
> >  			   (buf[addr] != '\r')) {
> >  			xcode = -1;
> >  			printf("string too long till next CR\n");
> > --
> 
> Acked by: Prafulla Wadaskar <prafulla@marvell.com>
> I will pull this patch.

Applied to u-boot-marvell.git master branch

Regards...
Prafulla . . .

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-03  8:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-09 11:43 [U-Boot] [PATCH] km/ivm: fix string len check to support 7 char board names Holger Brunck
2012-08-14 14:23 ` Holger Brunck
  -- strict thread matches above, loose matches on Subject: below --
2012-08-14 11:16 Valentin Longchamp
2012-08-14 13:29 ` Prafulla Wadaskar
2012-09-03  8:46 ` Prafulla Wadaskar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.