LinuxTV Patchwork [PATCHv2,6/7] seco-cec: decrement HDMI device refcount

login
register
mail settings
Submitter Hans Verkuil
Date April 10, 2019, 9:13 a.m.
Message ID <20190410091334.8654-7-hverkuil-cisco@xs4all.nl>
Download mbox | patch
Permalink /patch/55590/
State Under Review
Delegated to: Hans Verkuil
Headers show

Comments

Hans Verkuil - April 10, 2019, 9:13 a.m.
The SECO CEC driver never decremented the HDMI device refcount.
CEC drivers only need the HDMI device pointer as a key in the
notifier list, it never accesses the device, so there is no
need to keep a reference.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/media/platform/seco-cec/seco-cec.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/drivers/media/platform/seco-cec/seco-cec.c b/drivers/media/platform/seco-cec/seco-cec.c
index a425a10540c1..e5080d6f5b2d 100644
--- a/drivers/media/platform/seco-cec/seco-cec.c
+++ b/drivers/media/platform/seco-cec/seco-cec.c
@@ -536,6 +536,7 @@  static int secocec_cec_get_notifier(struct cec_notifier **notify)
 				return -EPROBE_DEFER;
 
 			*notify = cec_notifier_get_conn(d, m->conn);
+			put_device(d);
 
 			return 0;
 		}

Privacy Policy