Wen Yang reported that some CEC drivers incremented the refcount of the HDMI device, but never decremented it, potentially leading to memory leaks. Rather than fixing each driver I decided to create a helper function that finds the HDMI device and handles the refcounting correctly. Two drivers (seco-cec and cros-ec-cec) still required a manual patch. Regards, Hans Hans Verkuil (7): cec-notifier: add cec_notifier_find_hdmi_dev helper meson: ao-cec: use new cec_notifier_find_hdmi_dev helper s5p_cec: use new cec_notifier_find_hdmi_dev helper stih_cec: use new cec_notifier_find_hdmi_dev helper tegra_cec: use new cec_notifier_find_hdmi_dev helper seco-cec: decrement HDMI device refcount cros-ec-cec: decrement HDMI device refcount drivers/media/cec/cec-notifier.c | 24 +++++++++++++++++++ .../media/platform/cros-ec-cec/cros-ec-cec.c | 1 + drivers/media/platform/meson/ao-cec.c | 16 ++++--------- drivers/media/platform/s5p-cec/s5p_cec.c | 16 ++++--------- drivers/media/platform/seco-cec/seco-cec.c | 1 + drivers/media/platform/sti/cec/stih-cec.c | 21 ++++++---------- drivers/media/platform/tegra-cec/tegra_cec.c | 14 ++++------- include/media/cec-notifier.h | 19 ++++++++++++++- 8 files changed, 65 insertions(+), 47 deletions(-) -- 2.20.1