[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z76MYRaWm9AE0SaW@google.com>
Date: Wed, 26 Feb 2025 03:37:05 +0000
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Parav Pandit <parav@...lanox.com>, Leon Romanovsky <leon@...nel.org>,
Maher Sanalla <msanalla@...dia.com>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] RDMA/core: fix a NULL-pointer dereference in
hw_stat_device_show()
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!
Powered by blists - more mailing lists