[PATCH] rtems-fdt/rtems-fdt.c: Fix bug in loop termination
Niteesh G. S.
niteesh.gs at gmail.com
Sun Mar 21 07:04:07 UTC 2021
On Sat, Mar 20, 2021 at 11:39 AM Gedare Bloom <gedare at rtems.org> wrote:
> This looks good to me. Is the bug also on 5? If so, a ticket should be
> opened and a patch filed for 5.2.
>
This bug is also present in 5.
I have filed a ticket for this https://devel.rtems.org/ticket/4350
> If someone cares to push this please go ahead. I wouldn't get to it
> until next week sometime. Niteesh, ping it on Tuesday if no one has
> pushed.
>
OK
>
> On Wed, Mar 17, 2021 at 8:51 PM G S Niteesh Babu <niteesh.gs at gmail.com>
> wrote:
> >
> > The while loop, loops infinitely in case of raw FDT data.
> > The loop condition (size) is not modified during iterations.
> > ---
> > cpukit/libmisc/rtems-fdt/rtems-fdt.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/cpukit/libmisc/rtems-fdt/rtems-fdt.c
> b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
> > index 0ea365314f..7747ba9bf8 100644
> > --- a/cpukit/libmisc/rtems-fdt/rtems-fdt.c
> > +++ b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
> > @@ -580,7 +580,7 @@ rtems_fdt_load (const char* filename,
> rtems_fdt_handle* handle)
> > close (bf);
> > return -RTEMS_FDT_ERR_READ_FAIL;
> > }
> > - r -= size;
> > + size -= r;
> > buf += r;
> > }
> > }
> > --
> > 2.17.1
> >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210321/d5847d98/attachment-0001.html>
More information about the devel
mailing list