resource-manager: Relocate add_resource() in create_resource() 94/289494/3
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 9 Mar 2023 00:23:06 +0000 (09:23 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 9 Mar 2023 04:30:34 +0000 (13:30 +0900)
commit5880b22f3e55b60c7b9326c51012b95f05416145
tree34620f81d92449d0268ad7ecf0669a2ef6312194
parenta2168a482945760ac86060304aac7b1d8bfcd6f8
resource-manager: Relocate add_resource() in create_resource()

If operations following the add_resource() fail, then it is necessary
to cleanup resource instance from hashtable that has been added by
add_resource(). Instead of impelementing cleanup, move add_resource()
to the end of create_resource() so that nothing follow add_resource().

Change-Id: I705a3dc3487c8ebf9e80cff51b7e89069a6a4f1a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/resource-manager/resource-manager.c