[Coverity] Fix Coverity issue
authorDonghak PARK <donghak.park@samsung.com>
Tue, 19 Sep 2023 08:29:22 +0000 (17:29 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Thu, 21 Sep 2023 09:03:20 +0000 (18:03 +0900)
Fix may be NULL and is dereferenced at blas_neon.cpp

Check NULL if failed to malloc

Signed-off-by: Donghak PARK <donghak.park@samsung.com>
nntrainer/tensor/blas_neon.cpp

index fe0183d..4dfe007 100644 (file)
@@ -247,10 +247,6 @@ void sgemv_transpose_neon(const float *A, const float *X, float *Y,
   } else if (cols % 4 == 0) {
     unsigned int n = cols / 4;
     bool *initialized = (bool *)malloc(sizeof(bool) * n);
-    if (initialized == nullptr) {
-      ml_loge("failed to malloc");
-      return;
-    }
 
     unsigned int step;
     for (unsigned int i = 0; i < cols / 4; ++i) {