misc: sram: remove redundant null pointer check before of_node_put
authorzhong jiang <zhongjiang@huawei.com>
Sun, 16 Sep 2018 13:08:45 +0000 (21:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Sep 2018 18:20:59 +0000 (20:20 +0200)
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>
drivers/misc/sram.c

index 74b183baf044d1765d22ee9577cd31871bf9eb60..80d8cbe8c01ab7569f92930a70a8de93b91cac49 100644 (file)
@@ -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;