OSDN Git Service

vdpa: ifcvf: Do proper cleanup if IFCVF init fails
authorTanmay Bhushan <007047221b@gmail.com>
Tue, 27 Dec 2022 21:02:16 +0000 (22:02 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 27 Jan 2023 11:18:41 +0000 (06:18 -0500)
commit6b04456e248761cf68f562f2fd7c04e591fcac94
tree820d64b064b5586f036cac3bcad10dc9ba75b983
parent6dd88fd59da84631b5fe5c8176931c38cfa3b265
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>
drivers/vdpa/ifcvf/ifcvf_main.c