[dpdk-dev] [PATCH] pipeline: fix build with glibc < 2.26

David Marchand david.marchand at redhat.com
Fri Oct 2 13:50:32 CEST 2020


On Fri, Oct 2, 2020 at 12:38 PM Dumitrescu, Cristian
<cristian.dumitrescu at intel.com> wrote:
> > -----Original Message-----
> > From: David Marchand <david.marchand at redhat.com>
> > Sent: Friday, October 2, 2020 9:29 AM
> > To: dev at dpdk.org
> > Cc: Dumitrescu, Cristian <cristian.dumitrescu at intel.com>
> > Subject: [PATCH] pipeline: fix build with glibc < 2.26
> >
> > reallocarray has been introduced in glibc 2.26 but we still support
> > glibc >= 2.7.
> > Simply replace with realloc, as the considered sizes are unlikely to
> > overflow.
> >
> > """
> > The reallocarray() function changes the size of the memory block
> > pointed to by ptr to be large enough for an array of nmemb elements,
> > each of which is size bytes.  It is equivalent to the call
> >
> >        realloc(ptr, nmemb * size);
> >
> > However, unlike that realloc() call, reallocarray() fails safely in
> > the case where the multiplication would overflow.  If such an over‐
> > flow occurs, reallocarray() returns NULL, sets errno to ENOMEM, and
> > leaves the original block of memory unchanged.
> > """
> >
> > Fixes: 3ca60ceed79a ("pipeline: add SWX pipeline specification file")
> >
> > Signed-off-by: David Marchand <david.marchand at redhat.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>

Applied.


-- 
David Marchand



More information about the dev mailing list