From: John Miller Date: Tue, 16 May 2017 16:14:18 +0000 (-0400) Subject: net/ark: fix return value of null not checked X-Git-Tag: spdx-start~3162 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2f3b88fbabc580ba9501be900ba9e7f95508ac09;p=dpdk.git net/ark: fix return value of null not checked Coverity issue: 144517 Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville") Cc: stable@dpdk.org Signed-off-by: John Miller --- diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 94dee0b461..bbff4777f1 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -899,6 +899,12 @@ process_file_args(const char *key, const char *value, void *extra_args) int size = 0; int first = 1; + if (file == NULL) { + PMD_DRV_LOG(ERR, "Unable to open " + "config file %s\n", value); + return -1; + } + while (fgets(line, sizeof(line), file)) { size += strlen(line); if (size >= ARK_MAX_ARG_LEN) {