linux-stable/drivers/rpmsg
Colin Ian King 245af7ee61 rpmsg: smd: fix memory leak on channel create
commit 940c620d6a upstream.

Currently a failed allocation of channel->name leads to an
immediate return without freeing channel. Fix this by setting
ret to -ENOMEM and jumping to an exit path that kfree's channel.

Detected by CoverityScan, CID#1473692 ("Resource Leak")

Fixes: 53e2822e56 ("rpmsg: Introduce Qualcomm SMD backend")
Cc: stable@vger.kernel.org
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13 11:17:03 -08:00
..
Kconfig rpmsg: smd: fix dependency on QCOM_SMD=n 2016-09-12 07:05:13 -07:00
Makefile rpmsg: Introduce Qualcomm SMD backend 2016-09-08 22:15:26 -07:00
qcom_smd.c rpmsg: smd: fix memory leak on channel create 2018-11-13 11:17:03 -08:00
rpmsg_core.c rpmsg: virtio_rpmsg_bus: fix channel creation 2017-01-26 08:24:44 +01:00
rpmsg_internal.h rpmsg: Hide rpmsg indirection tables 2016-09-08 22:15:24 -07:00
virtio_rpmsg_bus.c rpmsg: Allow callback to return errors 2016-09-08 22:15:25 -07:00