summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorEvgeny Novikov <novikov@ispras.ru>2020-06-18 15:15:38 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-07-04 12:23:46 +0200
commit3b4cfc6966ecaefdf46a1369923a55e7bdc86d19 (patch)
tree2a85275ee69a20e806757a16a7b9c3b2c81409d8 /drivers/media/rc
parent39c2cf7544d63882709236ca2fb801db7cc2bc52 (diff)
downloadlinux-3b4cfc6966ecaefdf46a1369923a55e7bdc86d19.tar.bz2
media: rc: return proper error code on error handling path in init
If lirc_dev_init() fails during module initialization, rc_core_init() returns 0 denoting success. This can cause different issues during further operation of the module. The patch fixes the return value of rc_core_init() on the corresponding error handling path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov <novikov@ispras.ru> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/rc-main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index d7064d664d52..7b53066d9d07 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -2052,7 +2052,7 @@ static int __init rc_core_init(void)
if (rc) {
pr_err("rc_core: unable to init lirc\n");
class_unregister(&rc_class);
- return 0;
+ return rc;
}
led_trigger_register_simple("rc-feedback", &led_feedback);