You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/06 16:38:53 UTC

[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3454: syslog: Proper uninit of syslog_device.

gustavonihei commented on a change in pull request #3454:
URL: https://github.com/apache/incubator-nuttx/pull/3454#discussion_r608010726



##########
File path: drivers/syslog/syslog_device.c
##########
@@ -435,22 +435,44 @@ void syslog_dev_uninitialize(FAR struct syslog_channel_s *channel)
 {
   FAR struct syslog_dev_s *syslog_dev = (FAR struct syslog_dev_s *)channel;
 
-  /* Check if the system is ready */
+  /* Uninitializing a SYSLOG device should not take place within
+   * interrupt context.
+   */
 
-  if (syslog_dev_outputready(syslog_dev) < 0)
+  if (up_interrupt_context() || getpid() == 0)
     {
+      DEBUGASSERT(!up_interrupt_context() && getpid() != 0);
       return;
     }
 
-  /* Attempt to flush any buffered data */
+  /* The device cannot be unititialized while it is being

Review comment:
       ```suggestion
     /* The device cannot be uninitialized while it is being
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org