[dpdk-dev] [PATCH 2/2] devargs: remove limit on parameters length

David Marchand david.marchand at 6wind.com
Thu Jan 8 09:19:09 CET 2015


On Wed, Jan 7, 2015 at 11:59 PM, Stephen Hemminger <
stephen at networkplumber.org> wrote:

> On Wed,  7 Jan 2015 14:03:29 +0100
> David Marchand <david.marchand at 6wind.com> wrote:
>
> > +     buf = strdup(devargs_str);
> > +     if (buf == NULL) {
> > +             RTE_LOG(ERR, EAL, "cannot allocate temp memory for
> devargs\n");
> > +             goto fail;
> > +     }
> > +
>
> If string is only used in same function you might consider using strdupa()
> which avoids
> worrying about freeing in error paths.
>

Hum, why not.
My only concern is strdupa() availability on BSD.

-- 
David Marchand


More information about the dev mailing list