Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vdpa: ifcvf: Do proper cleanup if IFCVF init fails

ifcvf_mgmt_dev leaks memory if it is not freed before
returning. Call is made to correct return statement
so memory does not leak. ifcvf_init_hw does not take
care of this so it is needed to do it here.

Signed-off-by: Tanmay Bhushan <007047221b@gmail.com>
Message-Id: <772e9fe133f21fa78fb98a2ebe8969efbbd58e3c.camel@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Zhu Lingshan <lingshan.zhu@intel.com>

authored by

Tanmay Bhushan and committed by
Michael S. Tsirkin
6b04456e 6dd88fd5

+1 -1
+1 -1
drivers/vdpa/ifcvf/ifcvf_main.c
··· 849 849 ret = ifcvf_init_hw(vf, pdev); 850 850 if (ret) { 851 851 IFCVF_ERR(pdev, "Failed to init IFCVF hw\n"); 852 - return ret; 852 + goto err; 853 853 } 854 854 855 855 for (i = 0; i < vf->nr_vring; i++)