diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-06-17 04:40:08 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2022-06-17 09:29:50 +0300 |
commit | 278811d5a7b2af4e737c88ab3137d3ccc0732ac1 (patch) | |
tree | 6b61244572c2af398960888a62f89190fab7fc5e /drivers | |
parent | 6f6536a0e309177882975222d73984d1b5ad3bdd (diff) | |
download | linux-278811d5a7b2af4e737c88ab3137d3ccc0732ac1.tar.xz |
mtd: parsers: scpart: add missing of_node_put() in scpart_parse()
of_get_child_by_name() will increase the refcount of 'ofpart_node',
so add of_node_put() after using it to avoid refcount leak.
Fixes: 9b78ef0c7997 ("mtd: parsers: add support for Sercomm partitions")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220617014008.851583-1-yangyingliang@huawei.com
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/parsers/scpart.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/parsers/scpart.c b/drivers/mtd/parsers/scpart.c index bc40e25dc105..02601bb33de4 100644 --- a/drivers/mtd/parsers/scpart.c +++ b/drivers/mtd/parsers/scpart.c @@ -219,6 +219,7 @@ static int scpart_parse(struct mtd_info *master, of_node_put(pp); free: + of_node_put(ofpart_node); kfree(scpart_map); if (res <= 0) kfree(parts); |