[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YynsesGyvJl26jDI@nvidia.com>
Date: Tue, 20 Sep 2022 13:38:18 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: Longfang Liu <liulongfang@...wei.com>,
shameerali.kolothum.thodi@...wei.com, cohuck@...hat.com,
linux-kernel@...r.kernel.org, linuxarm@...neuler.org
Subject: Re: [PATCH 1/5] hisi_acc_vfio_pci: Fixes a memory leak bug
On Tue, Sep 20, 2022 at 10:34:43AM -0600, Alex Williamson wrote:
> On Thu, 15 Sep 2022 09:31:53 +0800
> Longfang Liu <liulongfang@...wei.com> wrote:
>
> > During the stop copy phase of live migration, the driver allocates
> > a memory for the migrated data to save the data.
> >
> > When an exception occurs when the driver reads device data, the driver
> > will report an error to qemu and exit the current migration state.
> > But this memory is not released, which will lead to a memory
> > leak problem.
Why isn't it released? The fput() releases it:
static int hisi_acc_vf_release_file(struct inode *inode, struct file *filp)
{
struct hisi_acc_vf_migration_file *migf = filp->private_data;
hisi_acc_vf_disable_fd(migf);
mutex_destroy(&migf->lock);
kfree(migf);
^^^^^^^^^^
This patch looks wrong to me.
Jason
Powered by blists - more mailing lists