From 6f2fdb87a5c60d54467f193c4a5e786622073e7b Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Fri, 28 Apr 2017 12:24:30 +0100 Subject: [PATCH] Upstream CEC patch to fix STi issues --- kernel.spec | 6 +++ ...e-BUG-when-CONFIG_RC_CORE-CEC_CAP_RC.patch | 45 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 media-cec-Fix-runtime-BUG-when-CONFIG_RC_CORE-CEC_CAP_RC.patch diff --git a/kernel.spec b/kernel.spec index 7b3417437..128e977c6 100644 --- a/kernel.spec +++ b/kernel.spec @@ -554,6 +554,9 @@ Patch437: bcm283x-hdmi-audio.patch # https://www.spinics.net/lists/arm-kernel/msg554183.html Patch438: arm-imx6-hummingboard2.patch +# https://lkml.org/lkml/2017/4/4/316 +Patch339: media-cec-Fix-runtime-BUG-when-CONFIG_RC_CORE-CEC_CAP_RC.patch + Patch440: arm64-Add-option-of-13-for-FORCE_MAX_ZONEORDER.patch Patch460: lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch @@ -2183,6 +2186,9 @@ fi # # %changelog +* Fri Apr 28 2017 Peter Robinson +- Upstream CEC patch to fix STi issues + * Thu Apr 27 2017 Laura Abbott - 4.11.0-0.rc8.git3.1 - Linux v4.11-rc8-75-gf832460 diff --git a/media-cec-Fix-runtime-BUG-when-CONFIG_RC_CORE-CEC_CAP_RC.patch b/media-cec-Fix-runtime-BUG-when-CONFIG_RC_CORE-CEC_CAP_RC.patch new file mode 100644 index 000000000..7a29d72bf --- /dev/null +++ b/media-cec-Fix-runtime-BUG-when-CONFIG_RC_CORE-CEC_CAP_RC.patch @@ -0,0 +1,45 @@ +From patchwork Tue Apr 4 12:32:19 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [2/2, media] cec: Fix runtime BUG when (CONFIG_RC_CORE && !CEC_CAP_RC) +From: Lee Jones +X-Patchwork-Id: 9661691 +Message-Id: <20170404123219.22040-2-lee.jones@linaro.org> +To: hans.verkuil@cisco.com, + mchehab@kernel.org +Cc: benjamin.gaignard@st.com, patrice.chotard@st.com, + linux-kernel@vger.kernel.org, kernel@stlinux.com, + Lee Jones , linux-arm-kernel@lists.infradead.org, + linux-media@vger.kernel.org +Date: Tue, 4 Apr 2017 13:32:19 +0100 + +Currently when the RC Core is enabled (reachable) core code located +in cec_register_adapter() attempts to populate the RC structure with +a pointer to the 'parent' passed in by the caller. + +Unfortunately if the caller did not specify RC capibility when calling +cec_allocate_adapter(), then there will be no RC structure to populate. + +This causes a "NULL pointer dereference" error. + +Fixes: f51e80804f0 ("[media] cec: pass parent device in register(), not allocate()") +Signed-off-by: Lee Jones +--- + drivers/media/cec/cec-core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c +index 06a312c..d64937b 100644 +--- a/drivers/media/cec/cec-core.c ++++ b/drivers/media/cec/cec-core.c +@@ -286,8 +286,8 @@ int cec_register_adapter(struct cec_adapter *adap, + adap->devnode.dev.parent = parent; + + #if IS_REACHABLE(CONFIG_RC_CORE) +- adap->rc->dev.parent = parent; + if (adap->capabilities & CEC_CAP_RC) { ++ adap->rc->dev.parent = parent; + res = rc_register_device(adap->rc); + + if (res) {