aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-09-16 21:08:45 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-25 20:20:59 +0200
commit3104389edc012e2567cabb94af8763121c33e72b (patch)
tree775e711d59dfe308eee3262b8d184d8cb7e203a1 /drivers/misc
parentfirmware: vpd: fix spelling mistake "partion" -> "partition" (diff)
downloadlinux-dev-3104389edc012e2567cabb94af8763121c33e72b.tar.xz
linux-dev-3104389edc012e2567cabb94af8763121c33e72b.zip
misc: sram: remove redundant null pointer check before of_node_put
of_node_put has taken the null pinter check into account. So it is safe to remove the duplicated check before of_node_put. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/sram.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 74b183baf044..80d8cbe8c01a 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -323,10 +323,8 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res)
cur_start = block->start + block->size;
}
- err_chunks:
- if (child)
- of_node_put(child);
-
+err_chunks:
+ of_node_put(child);
kfree(rblocks);
return ret;