public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Zhu, Lingshan" <lingshan.zhu@intel.com>
To: Jason Wang <jasowang@redhat.com>, Tanmay Bhushan <007047221b@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vdpa: ifcvf: Do proper cleanup if IFCVF init fails
Date: Thu, 29 Dec 2022 12:25:33 +0800	[thread overview]
Message-ID: <65fe4913-0f05-6b52-191e-d28628dcf2eb@intel.com> (raw)
In-Reply-To: <CACGkMEv-DradKs+k7AT50jTxO7S3DX-hJf0EQpsUp7WZii49nw@mail.gmail.com>



On 12/28/2022 2:58 PM, Jason Wang wrote:
> On Wed, Dec 28, 2022 at 5:15 AM Tanmay Bhushan <007047221b@gmail.com> wrote:
>>  From 7eae04667ddaac8baa4812d48ef2c942cedef946 Mon Sep 17 00:00:00 2001
>> From: Tanmay Bhushan <007047221b@gmail.com>
>> Date: Tue, 27 Dec 2022 22:02:16 +0100
>> Subject: [PATCH] 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>
> Acked-by: Jason Wang <jasowang@redhat.com>
>
> Thanks
Acked-by: Zhu Lingshan <lingshan.zhu@intel.com>

Thanks
>
>> ---
>>   drivers/vdpa/ifcvf/ifcvf_main.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c
>> b/drivers/vdpa/ifcvf/ifcvf_main.c
>> index f9c0044c6442..44b29289aa19 100644
>> --- a/drivers/vdpa/ifcvf/ifcvf_main.c
>> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c
>> @@ -849,7 +849,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const
>> struct pci_device_id *id)
>>          ret = ifcvf_init_hw(vf, pdev);
>>          if (ret) {
>>                  IFCVF_ERR(pdev, "Failed to init IFCVF hw\n");
>> -               return ret;
>> +               goto err;
>>          }
>>
>>          for (i = 0; i < vf->nr_vring; i++)
>> --
>> 2.34.1
>>
>>


  reply	other threads:[~2022-12-29  4:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 21:15 [PATCH] vdpa: ifcvf: Do proper cleanup if IFCVF init fails Tanmay Bhushan
2022-12-28  6:58 ` Jason Wang
2022-12-29  4:25   ` Zhu, Lingshan [this message]
2023-01-27 10:37 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65fe4913-0f05-6b52-191e-d28628dcf2eb@intel.com \
    --to=lingshan.zhu@intel.com \
    --cc=007047221b@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox