summaryrefslogtreecommitdiff
path: root/drivers/media/cec/cec-adap.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-08-23 14:07:21 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-08-26 12:30:14 +0300
commit8f4b5b0af7e451a4c6698ad3441dde8d1286c80d (patch)
tree8b7b8ad8fc1066d13036284e5be111ba4d330464 /drivers/media/cec/cec-adap.c
parent577bbf23b758848f0c4a50d346460b690c753024 (diff)
downloadlinux-8f4b5b0af7e451a4c6698ad3441dde8d1286c80d.tar.xz
media: cec-adap: return from cec_s_conn_info() if adap is invalid
Check if cec_s_conn_info is called with a valid cec adapter, do nothing if it is invalid. This makes it possible to call this function even if CEC support is disabled in the kernel config. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/cec/cec-adap.c')
-rw-r--r--drivers/media/cec/cec-adap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/cec/cec-adap.c b/drivers/media/cec/cec-adap.c
index 451c61bde4d4..5ef7daeb8cbd 100644
--- a/drivers/media/cec/cec-adap.c
+++ b/drivers/media/cec/cec-adap.c
@@ -1614,6 +1614,9 @@ EXPORT_SYMBOL_GPL(cec_s_phys_addr_from_edid);
void cec_s_conn_info(struct cec_adapter *adap,
const struct cec_connector_info *conn_info)
{
+ if (IS_ERR_OR_NULL(adap))
+ return;
+
if (!(adap->capabilities & CEC_CAP_CONNECTOR_INFO))
return;