yangyalei commented on code in PR #17459:
URL: https://github.com/apache/nuttx/pull/17459#discussion_r2619309150
##########
audio/audio.c:
##########
@@ -1275,6 +1275,11 @@ static inline void audio_dequeuebuffer(FAR struct
audio_upperhalf_s *upper,
audinfo("Entry\n");
+ if (upper->apbs)
Review Comment:
Done
##########
audio/audio.c:
##########
@@ -192,47 +218,61 @@ static int audio_close(FAR struct file *filep)
{
FAR struct inode *inode = filep->f_inode;
FAR struct audio_upperhalf_s *upper = inode->i_private;
+ FAR struct audio_openpriv_s *priv = filep->f_priv;
+ FAR struct audio_openpriv_s *curr;
+ FAR struct audio_openpriv_s *prev;
+ irqstate_t flags;
int ret;
- audinfo("crefs: %d\n", upper->crefs);
-
/* Get exclusive access to the device structures */
ret = nxmutex_lock(&upper->lock);
if (ret < 0)
{
- goto errout;
+ return ret;
}
- /* Decrement the references to the driver. If the reference count will
- * decrement to 0, then uninitialize the driver.
- */
+ flags = spin_lock_irqsave(&upper->spinlock);
+
+ /* find and drop priv from list */
- if (upper->crefs > 1)
+ for (prev = NULL, curr = upper->head; curr && curr != priv;
+ prev = curr, curr = curr->flink);
+
+ if (prev)
Review Comment:
Done
--
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]