From: Wook Song Date: Fri, 23 Aug 2019 03:46:35 +0000 (+0900) Subject: [Core/IP] bugfix: Make sure to return negative value for the error case X-Git-Tag: accepted/tizen/unified/20220103.130045~692 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73bbdb1c8444edc3e90a20a769520c151740c8e6;p=platform%2Fadaptation%2Fnpu%2Ftrix-engine.git [Core/IP] bugfix: Make sure to return negative value for the error case 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 --- diff --git a/src/core/ip/plugin-comm-ip.c b/src/core/ip/plugin-comm-ip.c index c42c779..067cc9b 100644 --- a/src/core/ip/plugin-comm-ip.c +++ b/src/core/ip/plugin-comm-ip.c @@ -484,10 +484,14 @@ int registerNPUmodel(npudev_h dev, generic_buffer *model, uint32_t *modelid) 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; }