Re: [PATCH] usb: typec: mux: Fix typec_switch_match()

Marek Vasut <[email protected]>
Newsgroups dev.linux.lists.regressions,org.kernel.vger.linux-kernel,org.kernel.vger.linux-usb,org.kernel.vger.stable
Message-ID <[email protected]>
On 8/18/26 10:32 AM, Thorsten Leemhuis wrote:
> On 8/17/26 20:22, Marek Vasut wrote:
>> The fwnode_typec_switch_get() sporadically returns NULL instead of an
>> -EPROBE_DEFER for orientation-switch described in DT.
> 
> Hi Marek! Just to make sure, have you seen the patch submission
> "usb: typec: mux: initialize orientation switch array"?
> https://lore.kernel.org/all/[email protected]/
> 
> It has a fixes tag for the commit you mention and reads: ""Commit
> a53b4f9c51a9 ("usb: typec: mux: avoid duplicated orientation switches")
> started using the orientation switch result array as state for duplicate
> detection, but left the array uninitialized.
> 
> The first match therefore scans indeterminate stack contents before any
> result has been stored. [...]""
That seems like a different issue -- even if the sw_devs[] array is 
NULL-initialized, if to_typec_switch_dev() returns NULL, then the 
comparison between to_typec_switch_dev() and sw_devs[] would still be 
true and the match callback would return NULL instead of EPROBE_DEFER.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.