From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B43C222A814 for ; Wed, 26 Feb 2025 03:37:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740541032; cv=none; b=IRx6ARTFcmAA2g5IHU57WVsha9QqvxknJBy/OPH6xKtPVG54plZteK1Fdq6/ErAq96Eb8r/Dw89VuwijLyGLg6uuoCbDeqnwNlKQkScdRmUaD5SUdrhvO5Qu8zQINwhJiD4DrXA5y3lwjILSKIQgDRxCwC8arU8oXEQ3/7wD17c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740541032; c=relaxed/simple; bh=+d150ORAuwcNcBo0bktXkOORXUeaVvLFU+FwfnagMfw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rGPLVlJvha5rUs+KhvOGQ3VEN0Ew9mSzQ5AvBfxy7NgMvcUpD9xrK+byB8Ag055hXUJVP22TUTIhC7LD2YfUO/iIZNBgWfesFJdCz28HNdzu/ngSkgZA3pn1jS4qSVZquBJj0kay8FNCYn1/n5fsD3kWu5W74R3YEekZa43Ah+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Z3T5jCnf; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Z3T5jCnf" Date: Wed, 26 Feb 2025 03:37:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1740541029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OSEd15iaG/YVJV5R/ef6IG1gpof8ihg018EdijbCkTM=; b=Z3T5jCnfrOToJENKnoI4nrqp8h67TYclznwQJonLGnH1MdtaRh3U+rUtMFZPuW0Dk8odJH R4iQgoi7LhyL5GTLrvs8kGPdUDv01NPJGyMemu9nACJyOIPWXt0cJb/0+8XAOmWn/tADbD O2yePYAenoNjBuS57LxLyRnB5A5YBNs= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Jason Gunthorpe Cc: Parav Pandit , Leon Romanovsky , Maher Sanalla , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] RDMA/core: fix a NULL-pointer dereference in hw_stat_device_show() Message-ID: References: <20250221174347.GA314593@nvidia.com> <20250224151127.GT50639@nvidia.com> <20250224233004.GD520155@nvidia.com> <20250225131618.GN520155@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250225131618.GN520155@nvidia.com> X-Migadu-Flow: FLOW_OUT 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!