From: Dinghao Liu dinghao.liu@zju.edu.cn
mainline inclusion from mainline-v5.10-rc1 commit dbb8df5c2d27610a87b0168a8acc89d73fbfde94 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I47H3V CVE: NA
--------------------------------
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: Zheng Zengkai zhengzengkai@huawei.com Reviewed-by: Xiongfeng Wang wangxiongfeng2@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/ntb/hw/intel/ntb_hw_gen1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c b/drivers/ntb/hw/intel/ntb_hw_gen1.c index cae70e7fe5bd..adf790452209 100644 --- a/drivers/ntb/hw/intel/ntb_hw_gen1.c +++ b/drivers/ntb/hw/intel/ntb_hw_gen1.c @@ -1897,7 +1897,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);