diff options
author | Sean Young <sean@mess.org> | 2018-05-24 05:47:17 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-05-28 17:40:33 -0400 |
commit | d7832cd2a3c87eb6ae1e802c88b6fc56c5823f6d (patch) | |
tree | a5793e7980fdd373f1967bc10aa873bbb18a2416 /drivers/media/rc | |
parent | d24e56f6fbfbce79ae1da3ef7a790942e48676ef (diff) | |
download | linux-d7832cd2a3c87eb6ae1e802c88b6fc56c5823f6d.tar.bz2 |
media: rc: ensure input/lirc device can be opened after register
Since commit cb84343fced1 ("media: lirc: do not call close() or open() on
unregistered devices") rc_open() will return -ENODEV if rcdev->registered
is false. Ensure this is set before we register the input device and the
lirc device, else we have a short window where the neither the lirc or
input device can be opened.
Fixes: cb84343fced1 ("media: lirc: do not call close() or open() on unregistered devices")
Cc: stable@vger.kernel.org # v4.16+
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/rc-main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index b7071bde670a..2e222d9ee01f 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -1862,6 +1862,8 @@ int rc_register_device(struct rc_dev *dev) dev->device_name ?: "Unspecified device", path ?: "N/A"); kfree(path); + dev->registered = true; + if (dev->driver_type != RC_DRIVER_IR_RAW_TX) { rc = rc_setup_rx_device(dev); if (rc) @@ -1881,8 +1883,6 @@ int rc_register_device(struct rc_dev *dev) goto out_lirc; } - dev->registered = true; - dev_dbg(&dev->dev, "Registered rc%u (driver: %s)\n", dev->minor, dev->driver_name ? dev->driver_name : "unknown"); |