[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250130014805.rycrh7ty6wmi566u@synopsys.com>
Date: Thu, 30 Jan 2025 01:48:09 +0000
From: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC: Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Felipe Balbi <balbi@...nel.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Ferry Toth <fntoth@...il.com>
Subject: Re: [PATCH v1 2/3] usb: dwc3: gadget: Add support for
snps,reserved-endpoints property
On Tue, Jan 28, 2025, Andy Shevchenko wrote:
> On Tue, Jan 28, 2025 at 02:39:50AM +0000, Thinh Nguyen wrote:
> > On Wed, Jan 22, 2025, Andy Shevchenko wrote:
> > > On Wed, Jan 22, 2025 at 01:44:02AM +0000, Thinh Nguyen wrote:
> >
> > No. We track the total num_eps in dwc->num_eps. Then we do for-loop to
> > dwc->eps[i] and access the endpoint. Often we check if the endpoint is
> > NULL before accessing dwc->eps[i]. However, we don't do it everywhere.
> > So I ask for you to review to make sure that this change doesn't break
> > elsewhere where we may try to access dwc->eps[i] to an uninit endpoint
> > (Note I see at least 1 place e.g. dwc3_gadget_clear_tx_fifos that may
> > break)
>
> I see, so having my code as is also requiring to check all users of
> the eps array in the _gadget part_ of the driver to see if they won't
> crash due to NULL pointer dereference. Is it what you want?
> If so, definitely I will revisit that.
>
Yes, help double check that.
Thanks,
Thinh
Powered by blists - more mailing lists