xiaoxiang781216 commented on code in PR #20084:
URL: https://github.com/apache/nuttx/pull/20084#discussion_r3972015889


##########
sched/pthread/pthread_create.c:
##########
@@ -331,18 +331,21 @@ int nx_pthread_create(pthread_trampoline_t trampoline, 
FAR pthread_t *thread,
       clock_t repl_ticks;
       clock_t budget_ticks;
 
-      /* Convert timespec values to system clock ticks */
+      /* Validate the priority before initializing sporadic state */
 
-      repl_ticks = clock_time2ticks(&param.sched_ss_repl_period);
-      budget_ticks = clock_time2ticks(&param.sched_ss_init_budget);
+      if (param.sched_priority < SCHED_PRIORITY_MIN ||
+          param.sched_priority > SCHED_PRIORITY_MAX)
+        {
+          errcode = EINVAL;

Review Comment:
   let's remove errcode, set ret to -EINVAL directly



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to