[dpdk-dev] [PATCH] eal: Fix wrong error checking of rte_eal_parse_devargs_str()

David Marchand david.marchand at 6wind.com
Wed Jun 15 16:48:38 CEST 2016


On Wed, Jun 15, 2016 at 5:26 AM, Tetsuya Mukawa <mukawa at igel.co.jp> wrote:
> Currently, a return value of strdup() isn't checked correctly.
> The patch fixes it.
>
> Signed-off-by: Tetsuya Mukawa <mukawa at igel.co.jp>

Idem, the title does not need the function name to describe what is going wrong.

This might deserve a fixline, I traced this to 0fe11ec592b2 ("eal: add
vdev init and uninit").

> ---
>  lib/librte_eal/common/eal_common_devargs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c
> index 2bfe54a..e403717 100644
> --- a/lib/librte_eal/common/eal_common_devargs.c
> +++ b/lib/librte_eal/common/eal_common_devargs.c
> @@ -58,7 +58,7 @@ rte_eal_parse_devargs_str(const char *devargs_str,
>                 return -1;
>
>         *drvname = strdup(devargs_str);
> -       if (drvname == NULL)
> +       if (*drvname == NULL)
>                 return -1;
>
>         /* set the first ',' to '\0' to split name and arguments */
> --
> 2.7.4
>

-- 
David Marchand


More information about the dev mailing list