Commit ef42b90
usb: typec: anx7411: fix OF node reference leaks in anx7411_typec_switch_probe()
The refcounts of the OF nodes obtained by of_get_child_by_name() calls
in anx7411_typec_switch_probe() are not decremented. Replace them with
device_get_named_child_node() calls and store the return values to the
newly created fwnode_handle fields in anx7411_data, and call
fwnode_handle_put() on them in the error path and in the unregister
functions.
Fixes: e45d733 ("usb: typec: anx7411: Use of_get_child_by_name() instead of of_find_node_by_name()")
Cc: stable@vger.kernel.org
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20241126014909.3687917-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 645d56e commit ef42b90
1 file changed
Lines changed: 12 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
293 | 295 | | |
294 | 296 | | |
295 | 297 | | |
| |||
1099 | 1101 | | |
1100 | 1102 | | |
1101 | 1103 | | |
| 1104 | + | |
1102 | 1105 | | |
1103 | 1106 | | |
1104 | 1107 | | |
| |||
1107 | 1110 | | |
1108 | 1111 | | |
1109 | 1112 | | |
| 1113 | + | |
1110 | 1114 | | |
1111 | 1115 | | |
1112 | 1116 | | |
1113 | 1117 | | |
1114 | 1118 | | |
1115 | 1119 | | |
1116 | 1120 | | |
1117 | | - | |
1118 | 1121 | | |
1119 | | - | |
1120 | | - | |
| 1122 | + | |
| 1123 | + | |
1121 | 1124 | | |
1122 | 1125 | | |
1123 | | - | |
| 1126 | + | |
1124 | 1127 | | |
1125 | 1128 | | |
| 1129 | + | |
1126 | 1130 | | |
1127 | 1131 | | |
1128 | 1132 | | |
1129 | | - | |
1130 | | - | |
| 1133 | + | |
| 1134 | + | |
1131 | 1135 | | |
1132 | 1136 | | |
1133 | 1137 | | |
1134 | 1138 | | |
1135 | 1139 | | |
1136 | | - | |
| 1140 | + | |
1137 | 1141 | | |
1138 | 1142 | | |
| 1143 | + | |
1139 | 1144 | | |
1140 | 1145 | | |
1141 | 1146 | | |
| |||
0 commit comments