Skip to content

Commit 9be182d

Browse files
Chen Zhongjingregkh
authored andcommitted
driver core: Fix test_async_probe_init saves device in wrong array
In test_async_probe_init, second set of asynchronous devices are saved in sync_dev[sync_id], which should be async_dev[async_id]. This makes these devices not unregistered when exit. > modprobe test_async_driver_probe && \ > modprobe -r test_async_driver_probe && \ > modprobe test_async_driver_probe ... > sysfs: cannot create duplicate filename '/devices/platform/test_async_driver.4' > kobject_add_internal failed for test_async_driver.4 with -EEXIST, don't try to register things with the same name in the same directory. Fixes: 57ea974 ("driver core: Rewrite test_async_driver_probe to cover serialization and NUMA affinity") Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> Link: https://lore.kernel.org/r/20221125063541.241328-1-chenzhongjin@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 39af728 commit 9be182d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/base/test/test_async_driver_probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static int __init test_async_probe_init(void)
145145
calltime = ktime_get();
146146
for_each_online_cpu(cpu) {
147147
nid = cpu_to_node(cpu);
148-
pdev = &sync_dev[sync_id];
148+
pdev = &async_dev[async_id];
149149

150150
*pdev = test_platform_device_register_node("test_async_driver",
151151
async_id,

0 commit comments

Comments
 (0)