media: cros-ec-cec: decrement HDMI device refcount
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 10 Apr 2019 09:13:34 +0000 (05:13 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 22 Apr 2019 17:14:44 +0000 (13:14 -0400)
The CrosEC 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>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/cros-ec-cec/cros-ec-cec.c

index 7bc4d8a9af287a515e13fbaae7df0b41550b2067..068df9888dbf03001af6e4b814819dd105cf7f3e 100644 (file)
@@ -236,6 +236,7 @@ static int cros_ec_cec_get_notifier(struct device *dev,
                                return -EPROBE_DEFER;
 
                        *notify = cec_notifier_get_conn(d, m->conn);
+                       put_device(d);
                        return 0;
                }
        }