Re: [bug report][bisected] kmemleak in rdma_core observed during blktests nvme/rdma use siw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 08, 2024 at 12:56:37PM -0300, Jason Gunthorpe wrote:
> On Wed, May 08, 2024 at 05:31:00PM +0200, Zhu Yanjun wrote:
> > 在 2024/5/8 15:08, Yi Zhang 写道:
> > > So bisect shows it was introduced with below commit, please help check
> > > and fix it, thanks.
> > > 
> > > commit f8ef1be816bf9a0c406c696368c2264a9597a994
> > > Author: Chuck Lever <chuck.lever@xxxxxxxxxx>
> > > Date:   Mon Jul 17 11:12:32 2023 -0400
> > > 
> > >      RDMA/cma: Avoid GID lookups on iWARP devices
> > 
> > Not sure if the following can fix this problem or not.
> > Please let me know the test result.
> > Thanks a lot.
> > 
> > diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> > index 1e2cd7c8716e..901e6c40d560 100644
> > --- a/drivers/infiniband/core/cma.c
> > +++ b/drivers/infiniband/core/cma.c
> > @@ -715,9 +715,13 @@ cma_validate_port(struct ib_device *device, u32 port,
> >                 rcu_read_lock();
> >                 ndev = rcu_dereference(sgid_attr->ndev);
> >                 if (!net_eq(dev_net(ndev), dev_addr->net) ||
> > -                   ndev->ifindex != bound_if_index)
> > +                   ndev->ifindex != bound_if_index) {
> > +                       rdma_put_gid_attr(sgid_attr);
> >                         sgid_attr = ERR_PTR(-ENODEV);
> > +               }
> >                 rcu_read_unlock();
> > +               if (!IS_ERR(sgid_attr))
> > +                       rdma_put_gid_attr(sgid_attr);
> >                 goto out;
> >         }
> 
> That does look needed regardless!
> 
> Chuck?

Releasing the sgid_attr looks sensible.

Reviewed-by: Chuck Lever <chuck.lever@xxxxxxxxxx>

-- 
Chuck Lever




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux