Commit 3b5a611
net: dsa: microchip: Fix symetry in ksz_ptp_msg_irq_{setup/free}()
[ Upstream commit d0b8fec ]
The IRQ numbers created through irq_create_mapping() are only assigned
to ptpmsg_irq[n].num at the end of the IRQ setup. So if an error occurs
between their creation and their assignment (for instance during the
request_threaded_irq() step), we enter the error path and fail to
release the newly created virtual IRQs because they aren't yet assigned
to ptpmsg_irq[n].num.
Move the mapping creation to ksz_ptp_msg_irq_setup() to ensure symetry
with what's released by ksz_ptp_msg_irq_free().
In the error path, move the irq_dispose_mapping to the out_ptp_msg label
so it will be called only on created IRQs.
Cc: stable@vger.kernel.org
Fixes: cc13ab1 ("net: dsa: microchip: ptp: enable interrupt for timestamping")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@bootlin.com>
Link: https://patch.msgid.link/20251120-ksz-fix-v6-5-891f80ae7f8f@bootlin.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 70ad645 commit 3b5a611
1 file changed
Lines changed: 7 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1099 | 1099 | | |
1100 | 1100 | | |
1101 | 1101 | | |
| 1102 | + | |
1102 | 1103 | | |
1103 | 1104 | | |
1104 | 1105 | | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1105 | 1109 | | |
1106 | 1110 | | |
1107 | 1111 | | |
1108 | 1112 | | |
1109 | 1113 | | |
1110 | 1114 | | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | 1115 | | |
1116 | 1116 | | |
1117 | 1117 | | |
| |||
1141 | 1141 | | |
1142 | 1142 | | |
1143 | 1143 | | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | 1144 | | |
1148 | 1145 | | |
1149 | 1146 | | |
| |||
1165 | 1162 | | |
1166 | 1163 | | |
1167 | 1164 | | |
1168 | | - | |
| 1165 | + | |
1169 | 1166 | | |
1170 | | - | |
1171 | | - | |
1172 | 1167 | | |
1173 | | - | |
| 1168 | + | |
| 1169 | + | |
1174 | 1170 | | |
1175 | 1171 | | |
1176 | 1172 | | |
| |||
0 commit comments