devargs: fix null dereferencing on failure
On failure devargs->args should not be accessed if devargs is NULL.
Fixes: c07691ae10
("devargs: remove limit on parameters length")
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
This commit is contained in:
parent
c3615e4a80
commit
a001589ec1
@ -124,12 +124,13 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
if (devargs->args)
|
||||
free(devargs->args);
|
||||
if (buf)
|
||||
free(buf);
|
||||
if (devargs)
|
||||
if (devargs) {
|
||||
free(devargs->args);
|
||||
free(devargs);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user