net/nfp: fix possible resource leak
authorYangchao Zhou <zhouyates@gmail.com>
Tue, 17 Apr 2018 05:59:08 +0000 (13:59 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 14:54:55 +0000 (15:54 +0100)
Fixes: c7e9729da6b5 ("net/nfp: support CPP")

Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c

index d26e782..4e6c666 100644 (file)
@@ -815,6 +815,7 @@ nfp6000_set_barsz(struct nfp_pcie_user *desc)
 
        if (fscanf(fp, "0x%lx 0x%lx 0x%lx", &start, &end, &flags) == 0) {
                printf("error reading resource file for bar size\n");
+               fclose(fp);
                return -1;
        }