* [PATCH] remoteproc: fix null pointer dereference on glink only platforms
@ 2018-04-03 18:15 Sibi Sankar
2018-04-06 5:54 ` Bjorn Andersson
0 siblings, 1 reply; 2+ messages in thread
From: Sibi Sankar @ 2018-04-03 18:15 UTC (permalink / raw)
To: bjorn.andersson; +Cc: linux-remoteproc, ohad, linux-arm-msm, Sibi Sankar
Currently calling list_del on smd subdev remove path results in
null pointer dereference on glink only platforms. Fix this by
adding safety checks in glink/smd subdev remove paths.
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
drivers/remoteproc/qcom_common.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
index 00602499713f..a0cd6a50913f 100644
--- a/drivers/remoteproc/qcom_common.c
+++ b/drivers/remoteproc/qcom_common.c
@@ -74,6 +74,9 @@ EXPORT_SYMBOL_GPL(qcom_add_glink_subdev);
*/
void qcom_remove_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink)
{
+ if (!glink->node)
+ return;
+
rproc_remove_subdev(rproc, &glink->subdev);
of_node_put(glink->node);
}
@@ -121,6 +124,9 @@ EXPORT_SYMBOL_GPL(qcom_add_smd_subdev);
*/
void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd)
{
+ if (!smd->node)
+ return;
+
rproc_remove_subdev(rproc, &smd->subdev);
of_node_put(smd->node);
}
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] remoteproc: fix null pointer dereference on glink only platforms
2018-04-03 18:15 [PATCH] remoteproc: fix null pointer dereference on glink only platforms Sibi Sankar
@ 2018-04-06 5:54 ` Bjorn Andersson
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2018-04-06 5:54 UTC (permalink / raw)
To: Sibi Sankar; +Cc: linux-remoteproc, ohad, linux-arm-msm
On Tue 03 Apr 11:15 PDT 2018, Sibi Sankar wrote:
> Currently calling list_del on smd subdev remove path results in
> null pointer dereference on glink only platforms. Fix this by
> adding safety checks in glink/smd subdev remove paths.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Thanks Sibi.
Regards,
Bjorn
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-06 5:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-03 18:15 [PATCH] remoteproc: fix null pointer dereference on glink only platforms Sibi Sankar
2018-04-06 5:54 ` Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox