Repository navigation
Commit f78f746
soundwire: stream: Fix bandwidth leak in multi-link aggregation failure
When preparing a multi-link aggregation stream, a failure on a subsequent
link during _sdw_prepare_stream() causes the stream preparation to fail.
However, the bandwidth allocated on the preceding successful links is never
released, causing a cumulative bandwidth leak.
Fix this by saving a snapshot of each bus's bandwidth before making any
modifications. In case of failure, we iterate through the stream's master
list and restore each bus to its original bandwidth state, ensuring an
atomic rollback and preventing any bandwidth leaks.
Signed-off-by: David Lin <david.lin@intel.com>1 parent 31d325a commit f78f746
2 files changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| |||
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| 173 | + | |
171 | 174 | | |
172 | 175 | | |
173 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1487 | 1487 | | |
1488 | 1488 | | |
1489 | 1489 | | |
1490 | | - | |
1491 | 1490 | | |
1492 | 1491 | | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
1493 | 1497 | | |
1494 | 1498 | | |
1495 | 1499 | | |
1496 | 1500 | | |
1497 | | - | |
1498 | 1501 | | |
1499 | 1502 | | |
1500 | 1503 | | |
1501 | 1504 | | |
1502 | | - | |
| 1505 | + | |
| 1506 | + | |
1503 | 1507 | | |
1504 | 1508 | | |
1505 | 1509 | | |
| |||
1550 | 1554 | | |
1551 | 1555 | | |
1552 | 1556 | | |
1553 | | - | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
1554 | 1564 | | |
1555 | 1565 | | |
1556 | 1566 | | |
| |||
0 commit comments