[CodeClean] check null before using handle accepted/tizen/7.0/unified/20240509.012446 accepted/tizen/8.0/unified/20240507.165655 accepted/tizen/unified/20240503.115751 accepted/tizen/unified/toolchain/20240508.012326 accepted/tizen/unified/x/20240507.051004
authorJaeyun Jung <jy1210.jung@samsung.com>
Thu, 2 May 2024 06:28:16 +0000 (15:28 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Thu, 2 May 2024 07:36:23 +0000 (16:36 +0900)
Code clean, check null pointer of train-offloading handle before using it.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
c/src/ml-api-service-training-offloading.c

index aebecb4..5edf3bf 100644 (file)
@@ -655,10 +655,11 @@ static gpointer
 _check_received_data_thread (gpointer data)
 {
   ml_training_services_s *training_s = (ml_training_services_s *) data;
-  int usec = training_s->time_limit * 1000000;
+  gint usec;
 
   g_return_val_if_fail (training_s != NULL, NULL);
 
+  usec = training_s->time_limit * 1000000;
   while (usec > 0) {
     g_usleep (100000);
     if (training_s->receiver_pipe_json_str != NULL) {