Commit 23261f0
ASoC: stm32: sai: fix OF node leak on probe
The reference taken to the sync provider OF node when probing the
platform device is currently only dropped if the set_sync() callback
fails during DAI probe.
Make sure to drop the reference on platform probe failures (e.g. probe
deferral) and on driver unbind.
This also avoids a potential use-after-free in case the DAI is ever
reprobed without first rebinding the platform driver.
Fixes: 5914d28 ("ASoC: stm32: sai: Add synchronization support")
Fixes: d4180b4 ("ASoC: stm32: sai: fix set_sync service")
Cc: Olivier Moysan <olivier.moysan@st.com>
Cc: stable@vger.kernel.org # 4.16: d4180b4
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: olivier moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20251124104908.15754-4-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 312ec2f commit 23261f0
2 files changed
Lines changed: 19 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
| |||
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
150 | | - | |
151 | | - | |
| 149 | + | |
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
155 | 153 | | |
156 | 154 | | |
157 | | - | |
| 155 | + | |
158 | 156 | | |
159 | 157 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 158 | + | |
165 | 159 | | |
166 | 160 | | |
167 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1586 | 1586 | | |
1587 | 1587 | | |
1588 | 1588 | | |
1589 | | - | |
| 1589 | + | |
| 1590 | + | |
1590 | 1591 | | |
1591 | 1592 | | |
1592 | 1593 | | |
| |||
1595 | 1596 | | |
1596 | 1597 | | |
1597 | 1598 | | |
1598 | | - | |
| 1599 | + | |
| 1600 | + | |
1599 | 1601 | | |
1600 | 1602 | | |
1601 | 1603 | | |
| |||
1609 | 1611 | | |
1610 | 1612 | | |
1611 | 1613 | | |
1612 | | - | |
| 1614 | + | |
| 1615 | + | |
1613 | 1616 | | |
1614 | 1617 | | |
1615 | 1618 | | |
| |||
1619 | 1622 | | |
1620 | 1623 | | |
1621 | 1624 | | |
1622 | | - | |
1623 | | - | |
1624 | | - | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
1625 | 1630 | | |
1626 | 1631 | | |
1627 | 1632 | | |
1628 | | - | |
| 1633 | + | |
1629 | 1634 | | |
1630 | 1635 | | |
1631 | 1636 | | |
| |||
1647 | 1652 | | |
1648 | 1653 | | |
1649 | 1654 | | |
| 1655 | + | |
| 1656 | + | |
1650 | 1657 | | |
1651 | 1658 | | |
1652 | 1659 | | |
| |||
1720 | 1727 | | |
1721 | 1728 | | |
1722 | 1729 | | |
| 1730 | + | |
1723 | 1731 | | |
1724 | 1732 | | |
1725 | 1733 | | |
| |||
1732 | 1740 | | |
1733 | 1741 | | |
1734 | 1742 | | |
| 1743 | + | |
1735 | 1744 | | |
1736 | 1745 | | |
1737 | 1746 | | |
| |||
0 commit comments