Commit 8f6aa39
usb: chipidea: core: convert ci_role_switch to local variable
When a system contains multiple USB controllers, the global ci_role_switch
variable may be overwritten by subsequent driver initialization code.
This can cause issues in the following cases:
- The 2nd ci_hdrc_probe() sees ci_role_switch.fwnode as non-NULL even
though the "usb-role-switch" property is not present for the controller.
- When the ci_hdrc device is unbound and bound again, ci_role_switch
fwnode will not be reassigned, and the old value will be used instead.
Convert ci_role_switch to a local variable to fix these issues.
Fixes: 05559f1 ("usb: chipidea: add role switch class support")
Cc: stable <stable@kernel.org>
Acked-by: Peter Chen <peter.chen@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://patch.msgid.link/20260427075755.3611217-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 2796646 commit 8f6aa39
1 file changed
Lines changed: 6 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | 658 | | |
665 | 659 | | |
666 | 660 | | |
| |||
787 | 781 | | |
788 | 782 | | |
789 | 783 | | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | 784 | | |
794 | 785 | | |
795 | 786 | | |
| |||
1033 | 1024 | | |
1034 | 1025 | | |
1035 | 1026 | | |
| 1027 | + | |
1036 | 1028 | | |
1037 | 1029 | | |
1038 | 1030 | | |
| |||
1179 | 1171 | | |
1180 | 1172 | | |
1181 | 1173 | | |
1182 | | - | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
1183 | 1179 | | |
1184 | 1180 | | |
1185 | 1181 | | |
| |||
0 commit comments