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

From: Marek Vasut

Date: Tue Aug 18 2026 - 07:42:54 EST


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/20260804083434.20885-1-i@xxxxx/

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.