[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180903165722.757028020@linuxfoundation.org>
Date: Mon, 3 Sep 2018 18:57:00 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Johan Hovold <johan@...nel.org>,
Andy Gross <andy.gross@...aro.org>
Subject: [PATCH 4.18 076/123] soc: qcom: rmtfs-mem: fix memleak in probe error paths
4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@...nel.org>
commit 78ee559d7fc65e37670a46cfbeaaa62cb014af67 upstream.
Make sure to set the mem device release callback before calling
put_device() in a couple of probe error paths so that the containing
object also gets freed.
Fixes: d1de6d6c639b ("soc: qcom: Remote filesystem memory driver")
Cc: stable <stable@...r.kernel.org> # 4.15
Cc: Bjorn Andersson <bjorn.andersson@...aro.org>
Signed-off-by: Johan Hovold <johan@...nel.org>
Signed-off-by: Andy Gross <andy.gross@...aro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/soc/qcom/rmtfs_mem.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/soc/qcom/rmtfs_mem.c
+++ b/drivers/soc/qcom/rmtfs_mem.c
@@ -184,6 +184,7 @@ static int qcom_rmtfs_mem_probe(struct p
device_initialize(&rmtfs_mem->dev);
rmtfs_mem->dev.parent = &pdev->dev;
rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups;
+ rmtfs_mem->dev.release = qcom_rmtfs_mem_release_device;
rmtfs_mem->base = devm_memremap(&rmtfs_mem->dev, rmtfs_mem->addr,
rmtfs_mem->size, MEMREMAP_WC);
@@ -206,8 +207,6 @@ static int qcom_rmtfs_mem_probe(struct p
goto put_device;
}
- rmtfs_mem->dev.release = qcom_rmtfs_mem_release_device;
-
ret = of_property_read_u32(node, "qcom,vmid", &vmid);
if (ret < 0 && ret != -EINVAL) {
dev_err(&pdev->dev, "failed to parse qcom,vmid\n");
Powered by blists - more mailing lists