FelipeMdeO commented on code in PR #19596:
URL: https://github.com/apache/nuttx/pull/19596#discussion_r3700327991


##########
drivers/sensors/sensor.c:
##########
@@ -809,6 +867,19 @@ static int sensor_close(FAR struct file *filep)
   sensor_update_latency(filep, upper, user, UINT32_MAX);
   sensor_update_nonwakeup(filep, upper, user, true);
 
+#ifdef CONFIG_SCHED_LPWORK
+  /* A close() racing an armed poll() would otherwise leave the worker
+   * queued against the user we are about to free. Clear fds first so a
+   * worker already running cannot re-arm itself past the cancel, then
+   * cancel outside the lock, since the worker takes it too.
+   */
+
+  nxrmutex_lock(&upper->lock);
+  user->fds = NULL;

Review Comment:
   Removed after implementation using wdog



-- 
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