media: platform: remove redundant null pointer check before of_node_put
authorzhong jiang <zhongjiang@huawei.com>
Sun, 16 Sep 2018 13:16:51 +0000 (09:16 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 24 Sep 2018 13:28:41 +0000 (09:28 -0400)
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>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/ti-vpe/cal.c

index cc052b2..5f9d4e0 100644 (file)
@@ -1747,14 +1747,10 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
        }
 
 cleanup_exit:
-       if (remote_ep)
-               of_node_put(remote_ep);
-       if (sensor_node)
-               of_node_put(sensor_node);
-       if (ep_node)
-               of_node_put(ep_node);
-       if (port)
-               of_node_put(port);
+       of_node_put(remote_ep);
+       of_node_put(sensor_node);
+       of_node_put(ep_node);
+       of_node_put(port);
 
        return ret;
 }