Core/NPU: Fix an SVACE issue (#283026)
authorWook Song <wook16.song@samsung.com>
Mon, 24 Mar 2025 05:15:28 +0000 (14:15 +0900)
committer송욱/SoC Architecture팀(SR)/삼성전자 <wook16.song@samsung.com>
Mon, 24 Mar 2025 06:16:25 +0000 (15:16 +0900)
This patch fixes an SVACE issue (#283026) related to
NO_CAST.INTEGER_OVERFLOW.

Change-Id: Idadbadc8e5d2a7791b1b483ba0500f1090c9f731
Signed-off-by: Wook Song <wook16.song@samsung.com>
src/core/npu/NPUdrvAPI_triv2.cc

index a64b32fb8ad11049f59b6059d45d942424fa5238..d7e1f61a5cab9ff18848e7db36ada3571bb8a798 100644 (file)
@@ -674,6 +674,7 @@ TrinityVision2API::getProfile (int req_id, npu_profile *profile, std::string pat
 #endif
 
   buff.req_id = meta.req_id;
+  buff.profile_buf = reinterpret_cast<std::uintptr_t> (profile->layers);
 
   uint32_t chunk_size;
   uint32_t pos = 0;
@@ -685,7 +686,7 @@ TrinityVision2API::getProfile (int req_id, npu_profile *profile, std::string pat
       chunk_size = PROFILE_MAXSIZE;
 
     buff.profile_pos = pos;
-    buff.profile_buf = reinterpret_cast<std::uintptr_t>(profile->layers) + pos;
+    buff.profile_buf += pos;
     buff.profile_size = chunk_size;
 
     ret = ioctl (this->getDeviceFD (), TRINITY_IOCTL_GET_PROFILE_BUFF, &buff);