rpmsg: smd: do not use mananged resources for endpoints and channels
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Mon, 4 Jun 2018 09:39:01 +0000 (10:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:23:13 +0000 (11:23 +0200)
commitec7ee4d60f25f9a4ba264090b2671346d078ed2a
treeca04cdcbaff30b8a251381203e5ffd7fcf1f051d
parent486684887ab588309c3497785412bb67e162b7a6
rpmsg: smd: do not use mananged resources for endpoints and channels

commit 4a2e84c6ed85434ce7843e4844b4d3263f7e233b upstream.

All the managed resources would be freed by the time release function
is invoked. Handling such memory in qcom_smd_edge_release() would do
bad things.

Found this issue while testing Audio usecase where the dsp is started up
and shutdown in a loop.

This patch fixes this issue by using simple kzalloc for allocating
channel->name and channel which is then freed in qcom_smd_edge_release().

Without this patch restarting a remoteproc would crash the system.
Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
Cc: <stable@vger.kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rpmsg/qcom_smd.c