net/softnic: fix file close
Checks
Commit Message
Coverity issue: 380976
Fixes: e3be2495 ("net/softnic: add pipeline code generation command")
Fix file close at pipeline code generation.
Signed-off-by: Harshad Narayane <harshad.suresh.narayane@intel.com>
Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
drivers/net/softnic/rte_eth_softnic_cli.c | 1 +
1 file changed, 1 insertion(+)
Comments
On 9/27/2022 5:42 AM, Harshad Narayane wrote:
> Coverity issue: 380976
> Fixes: e3be2495 ("net/softnic: add pipeline code generation command")
>
> Fix file close at pipeline code generation.
>
> Signed-off-by: Harshad Narayane <harshad.suresh.narayane@intel.com>
> Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Applied to dpdk-next-net/main, thanks.
@@ -230,6 +230,7 @@ cmd_softnic_pipeline_codegen(struct pmd_internals *softnic __rte_unused,
code_file = fopen(tokens[3], "w");
if (!code_file) {
snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]);
+ fclose(spec_file);
return;
}