anchao opened a new pull request, #20861:
URL: https://github.com/apache/nuttx/pull/20861

   ## Summary                                                                
                                                                             
   Fix a sensor upper-half lock leak in the direct read error path.          
                                                                             
   `sensor_read()` acquires the upper-half lock before handling the direct   
   fetch path. When direct fetch is supported and the caller passes a NULL   
   buffer, the previous code returned `-EINVAL` immediately without releasing
   the lock.                                                                 
                                                                             
   This change routes that error through the common `out` path so the lock is
   released before returning.                                                
                                                                             
   ## Impact                                                                 
                                                                             
   - Prevents leaving the sensor upper-half lock held after a NULL-buffer    
     direct read error.                                                      
   - Avoids blocking later sensor operations on the leaked lock.             
   - Successful read behavior is unchanged.                                  
   - Only affects the direct fetch error path.                               
                                                                             
   ## Testing                                                                
                                                                             
   sim/sensor         
   


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