]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ntb: intel: Fix memleak in intel_ntb_pci_probe
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Sun, 23 Aug 2020 06:55:12 +0000 (14:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:08:16 +0000 (10:08 +0100)
[ Upstream commit dbb8df5c2d27610a87b0168a8acc89d73fbfde94 ]

The default error branch of a series of pdev_is_gen calls
should free ndev just like what we've done in these calls.

Fixes: 26bfe3d0b227 ("ntb: intel: Add Icelake (gen4) support for Intel NTB")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ntb/hw/intel/ntb_hw_gen1.c

index 423f9b8fbbcf5e741dfc004d181188d16fcb9b26..fa561d455f7c86d1da453c4789437c13e8fba70b 100644 (file)
@@ -1893,7 +1893,7 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev,
                        goto err_init_dev;
        } else {
                rc = -EINVAL;
-               goto err_ndev;
+               goto err_init_pci;
        }
 
        ndev_reset_unsafe_flags(ndev);