In the 'registerNPUmodel' function, there is a case that returns 0
(which means NO ERROR) even if the 'registerNPUmodelmem' function is
failed. This patch fixes this bug.
Signed-off-by: Wook Song <wook16.song@samsung.com>
return 0;
out_deactivate:
- if ((err = hwmem_deactivate (hwmem_ptr)) < 0)
- logerr (TAG, "Error deactivating hwmem, errno: %d\n", err);
+ if (hwmem_deactivate (hwmem_ptr) < 0) {
+ logerr (TAG, "Failed to deactivate hwmm\n");
+ }
out_free:
- GET_MEM()->dealloc (hwmem_ptr);
+ if (GET_MEM()->dealloc (hwmem_ptr) < 0){
+ logerr (TAG, "Failed to deallocate hwmm\n");
+ }
+
return err;
}