Commit 4a00347
i2c: core: fix adapter debugfs creation
[ Upstream commit 07d5fb5 ]
Clients can be registered from bus notifier callbacks so the debugfs
directory needs to be created before registering the adapter as clients
use that directory as their debugfs parent.
Move debugfs creation before adapter registration to avoid having
clients create their debugfs directories in the debugfs root (which is
also more likely to fail due to name collisions).
Note that failure to allocate the adapter name must now be handled
explicitly as debugfs_create_dir() cannot handle a NULL name (unlike
device_add() which returns an error).
Fixes: 73febd7 ("i2c: create debugfs entry per adapter")
Cc: stable@vger.kernel.org # 6.8
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Stable-dep-of: ba14d7c ("i2c: core: fix adapter registration race")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent ad4322d commit 4a00347
1 file changed
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1546 | 1546 | | |
1547 | 1547 | | |
1548 | 1548 | | |
1549 | | - | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
1550 | 1553 | | |
1551 | 1554 | | |
1552 | | - | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
1553 | 1560 | | |
1554 | 1561 | | |
1555 | | - | |
| 1562 | + | |
1556 | 1563 | | |
1557 | 1564 | | |
1558 | | - | |
1559 | | - | |
1560 | 1565 | | |
1561 | 1566 | | |
1562 | 1567 | | |
| |||
1597 | 1602 | | |
1598 | 1603 | | |
1599 | 1604 | | |
1600 | | - | |
1601 | 1605 | | |
1602 | | - | |
| 1606 | + | |
| 1607 | + | |
1603 | 1608 | | |
1604 | 1609 | | |
1605 | 1610 | | |
1606 | | - | |
| 1611 | + | |
1607 | 1612 | | |
1608 | 1613 | | |
1609 | 1614 | | |
| |||
0 commit comments