Re: [PATCH] RDMA/core: fix a NULL-pointer dereference in hw_stat_device_show()
From: Jason Gunthorpe
Date: Tue Feb 25 2025 - 08:21:31 EST
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
Jason