Re: [PATCH] RDMA/core: fix a NULL-pointer dereference in hw_stat_device_show()

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

 



On Tue, Feb 25, 2025 at 09:16:18AM -0400, Jason Gunthorpe wrote:
> On Tue, Feb 25, 2025 at 03:42:28AM +0000, Roman Gushchin wrote:
> 
> > diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
> > index 0ded91f056f3..6998907fc779 100644
> > --- a/drivers/infiniband/core/device.c
> > +++ b/drivers/infiniband/core/device.c
> > @@ -956,6 +956,7 @@ static int add_one_compat_dev(struct ib_device *device,
> >         ret = device_add(&cdev->dev);
> >         if (ret)
> >                 goto add_err;
> > +       device->groups[2] = NULL;
> >         ret = ib_setup_port_attrs(cdev);
> >         if (ret)
> >                 goto port_err;
> 
> That's horrible - but OK, maybe something like that..
> 
> Does it work? Or does the driver core need groups after the initial
> setup?
> 
> Could we have two group lists and link them together? IIRC there was a
> way to do that without creating a sub directory

It does work.

I just sent a decent implementation of this idea, please, take a look.

Thank you!




[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