Skip to content

Commit 896111d

Browse files
seanyoungmchehab
authored andcommitted
media: rc: ensure that uevent can be read directly after rc device register
There is a race condition where if the /sys/class/rc0/uevent file is read before rc_dev->registered is set to true, -ENODEV will be returned. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1901089 Cc: [email protected] Fixes: a2e2d73 ("media: rc: do not access device via sysfs after rc_unregister_device()") Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 5c8fe58 commit 896111d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/rc/rc-main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,8 @@ int rc_register_device(struct rc_dev *dev)
19281928
goto out_raw;
19291929
}
19301930

1931+
dev->registered = true;
1932+
19311933
rc = device_add(&dev->dev);
19321934
if (rc)
19331935
goto out_rx_free;
@@ -1937,8 +1939,6 @@ int rc_register_device(struct rc_dev *dev)
19371939
dev->device_name ?: "Unspecified device", path ?: "N/A");
19381940
kfree(path);
19391941

1940-
dev->registered = true;
1941-
19421942
/*
19431943
* once the the input device is registered in rc_setup_rx_device,
19441944
* userspace can open the input device and rc_open() will be called

0 commit comments

Comments
 (0)