pipeline: adjust error code for internal function
Checks
Commit Message
Adjusting the error code for the internal function instruction_config
to match the rest of the code which is returning a negative value on
error. Cosmetic change.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
lib/librte_pipeline/rte_swx_pipeline.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
30/03/2021 12:19, Cristian Dumitrescu:
> Adjusting the error code for the internal function instruction_config
> to match the rest of the code which is returning a negative value on
> error. Cosmetic change.
>
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Applied, thanks
@@ -8049,20 +8049,20 @@ instruction_config(struct rte_swx_pipeline *p,
/* Memory allocation. */
instr = calloc(n_instructions, sizeof(struct instruction));
if (!instr) {
- err = ENOMEM;
+ err = -ENOMEM;
goto error;
}
data = calloc(n_instructions, sizeof(struct instruction_data));
if (!data) {
- err = ENOMEM;
+ err = -ENOMEM;
goto error;
}
for (i = 0; i < n_instructions; i++) {
char *string = strdup(instructions[i]);
if (!string) {
- err = ENOMEM;
+ err = -ENOMEM;
goto error;
}