All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib: sbi: Fix sbi_strnlen wrong count decrement
@ 2022-09-13  9:47 Rahul Pathak
  2022-09-13 10:52 ` Anup Patel
  0 siblings, 1 reply; 3+ messages in thread
From: Rahul Pathak @ 2022-09-13  9:47 UTC (permalink / raw)
  To: opensbi

count(maxlen) should not be decremented here

Fixes: 1901e8a287bc ("platform: Add minimal libc support.")
Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
---
 lib/sbi/sbi_string.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/sbi/sbi_string.c b/lib/sbi/sbi_string.c
index c163f3176506..9ebea693d0f6 100644
--- a/lib/sbi/sbi_string.c
+++ b/lib/sbi/sbi_string.c
@@ -59,7 +59,6 @@ size_t sbi_strnlen(const char *str, size_t count)
 	while (*str != '\0' && ret < count) {
 		ret++;
 		str++;
-		count--;
 	}
 
 	return ret;
-- 
2.34.1



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

* [PATCH] lib: sbi: Fix sbi_strnlen wrong count decrement
  2022-09-13  9:47 [PATCH] lib: sbi: Fix sbi_strnlen wrong count decrement Rahul Pathak
@ 2022-09-13 10:52 ` Anup Patel
  2022-09-13 11:58   ` Anup Patel
  0 siblings, 1 reply; 3+ messages in thread
From: Anup Patel @ 2022-09-13 10:52 UTC (permalink / raw)
  To: opensbi

On Tue, Sep 13, 2022 at 3:21 PM Rahul Pathak <rpathak@ventanamicro.com> wrote:
>
> count(maxlen) should not be decremented here
>
> Fixes: 1901e8a287bc ("platform: Add minimal libc support.")
> Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>

This one slipped through our reviews. Thanks for catching.

Reviewed-by: Anup Patel <anup@brainfault.org>

Regards,
Anup

> ---
>  lib/sbi/sbi_string.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/lib/sbi/sbi_string.c b/lib/sbi/sbi_string.c
> index c163f3176506..9ebea693d0f6 100644
> --- a/lib/sbi/sbi_string.c
> +++ b/lib/sbi/sbi_string.c
> @@ -59,7 +59,6 @@ size_t sbi_strnlen(const char *str, size_t count)
>         while (*str != '\0' && ret < count) {
>                 ret++;
>                 str++;
> -               count--;
>         }
>
>         return ret;
> --
> 2.34.1
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi


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

* [PATCH] lib: sbi: Fix sbi_strnlen wrong count decrement
  2022-09-13 10:52 ` Anup Patel
@ 2022-09-13 11:58   ` Anup Patel
  0 siblings, 0 replies; 3+ messages in thread
From: Anup Patel @ 2022-09-13 11:58 UTC (permalink / raw)
  To: opensbi

On Tue, Sep 13, 2022 at 4:22 PM Anup Patel <anup@brainfault.org> wrote:
>
> On Tue, Sep 13, 2022 at 3:21 PM Rahul Pathak <rpathak@ventanamicro.com> wrote:
> >
> > count(maxlen) should not be decremented here
> >
> > Fixes: 1901e8a287bc ("platform: Add minimal libc support.")
> > Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
>
> This one slipped through our reviews. Thanks for catching.
>
> Reviewed-by: Anup Patel <anup@brainfault.org>

Applied this patch immediately since it affects FDT parsing of
certain DT properties (such as "reg-names").

Regards,
Anup

>
> Regards,
> Anup
>
> > ---
> >  lib/sbi/sbi_string.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/lib/sbi/sbi_string.c b/lib/sbi/sbi_string.c
> > index c163f3176506..9ebea693d0f6 100644
> > --- a/lib/sbi/sbi_string.c
> > +++ b/lib/sbi/sbi_string.c
> > @@ -59,7 +59,6 @@ size_t sbi_strnlen(const char *str, size_t count)
> >         while (*str != '\0' && ret < count) {
> >                 ret++;
> >                 str++;
> > -               count--;
> >         }
> >
> >         return ret;
> > --
> > 2.34.1
> >
> >
> > --
> > opensbi mailing list
> > opensbi at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/opensbi


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

end of thread, other threads:[~2022-09-13 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13  9:47 [PATCH] lib: sbi: Fix sbi_strnlen wrong count decrement Rahul Pathak
2022-09-13 10:52 ` Anup Patel
2022-09-13 11:58   ` Anup Patel

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.