* [PATCH for v5.3] cec-adap: return from cec_s_conn_info() if adap is invalid
@ 2019-08-23 11:07 Hans Verkuil
0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2019-08-23 11:07 UTC (permalink / raw)
To: Linux Media Mailing List
Cc: Maling list - DRI developers, Dariusz Marcinkiewicz
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>
---
drivers/media/cec/cec-adap.c | 3 +++
1 file changed, 3 insertions(+)
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;
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-08-23 11:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23 11:07 [PATCH for v5.3] cec-adap: return from cec_s_conn_info() if adap is invalid Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).