qed: Fix PTT entry leak in the selftest error flow.
authorSudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
Wed, 28 Mar 2018 12:14:20 +0000 (05:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Mar 2018 18:29:55 +0000 (14:29 -0400)
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_selftest.c

index b88082f0b41a7745fe56422f079caffe43a0d065..cf1d4476f9d80b40a555d48d77d8c71c41a035d5 100644 (file)
@@ -128,7 +128,8 @@ int qed_selftest_nvram(struct qed_dev *cdev)
        rc = qed_mcp_bist_nvm_get_num_images(p_hwfn, p_ptt, &num_images);
        if (rc || !num_images) {
                DP_ERR(p_hwfn, "Failed getting number of images\n");
-               return -EINVAL;
+               rc = -EINVAL;
+               goto err0;
        }
 
        /* Iterate over images and validate CRC */