of: Use scope based kfree() cleanups
authorRob Herring <robh@kernel.org>
Tue, 9 Apr 2024 18:59:40 +0000 (13:59 -0500)
committerRob Herring <robh@kernel.org>
Mon, 15 Apr 2024 13:40:40 +0000 (08:40 -0500)
commit40b0f17453fca50165c9d56401be663448e9136c
treec3ba7211c1177690af02673aeffdee10f66dca9e
parent1c5e3d9bf33b811e1c6dd9081b322004acc4a1fd
of: Use scope based kfree() cleanups

Use the relatively new scope based kfree() cleanup to simplify error
handling. Doing so reduces the chances of memory leaks and simplifies
error paths by avoiding the need for goto statements.

Reviewed-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240409-dt-cleanup-free-v2-2-5b419a4af38d@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/base.c
drivers/of/dynamic.c
drivers/of/resolver.c