Эх сурвалжийг харах

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>
zhong jiang 6 жил өмнө
parent
commit
3104389edc
1 өөрчлөгдсөн 2 нэмэгдсэн , 4 устгасан
  1. 2 4
      drivers/misc/sram.c

+ 2 - 4
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;