You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anchao (via GitHub)" <gi...@apache.org> on 2026/10/21 05:29:15 UTC

[PR] net/pkt: allocate send callback before queueing IOB [nuttx]

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

   ## Summary                                                              
                                                                           
   Fix the packet socket buffered send error path by allocating the send   
   callback before enqueueing the prepared IOB.                            
                                                                           
   `pkt_sendmsg()` previously queued the IOB into `conn->write_q` before   
   allocating the send callback. If callback allocation failed after that, 
   the error path still jumped to `errout_with_iob` and freed the IOB even 
   though ownership had already moved to the connection write queue.       
                                                                           
   This change allocates and validates the callback before enqueueing the  
   IOB. The IOB remains locally owned until all resources needed to notify 
   the driver are available.                                               
                                                                           
   ## Impact                                                               
                                                                           
   - Avoids freeing an IOB after it has already been queued.               
   - Prevents corrupting the packet socket write queue on callback         
     allocation failure.                                                   
   - Keeps the successful send path behavior unchanged.                    
   - Affects buffered packet socket send only.                             
                                                                           
   ## Testing                                                              
   
   sim/matter


-- 
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: commits-unsubscribe@nuttx.apache.org

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


Re: [PR] net/pkt: allocate send callback before queueing IOB [nuttx]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20859:
URL: https://github.com/apache/nuttx/pull/20859#issuecomment-6309968993

   <!-- membrowse-pr-comment -->
   ## <img src="https://membrowse.com/membrowse-logo.svg" height="24" align="top"> MemBrowse Memory Report &middot; [Explore what changed →](https://membrowse.com/public/apache/nuttx?commit_sha=52d4525022bded0cba8661f6448f277bdb223cf7)
   
   
   *No memory changes detected for:*
   - [arduino-mega2560](https://membrowse.com/public/apache/nuttx/target/arduino-mega2560/compare?head=52d4525022bded0cba8661f6448f277bdb223cf7&base=a16dbf2100e6a1484a59cb41826034d01834b36d)
   - [esp32-devkitc](https://membrowse.com/public/apache/nuttx/target/esp32-devkitc/compare?head=52d4525022bded0cba8661f6448f277bdb223cf7&base=a16dbf2100e6a1484a59cb41826034d01834b36d)
   - [hifive1-revb](https://membrowse.com/public/apache/nuttx/target/hifive1-revb/compare?head=52d4525022bded0cba8661f6448f277bdb223cf7&base=a16dbf2100e6a1484a59cb41826034d01834b36d)
   - [mirtoo](https://membrowse.com/public/apache/nuttx/target/mirtoo/compare?head=52d4525022bded0cba8661f6448f277bdb223cf7&base=a16dbf2100e6a1484a59cb41826034d01834b36d)
   - [qemu-armv8a](https://membrowse.com/public/apache/nuttx/target/qemu-armv8a/compare?head=52d4525022bded0cba8661f6448f277bdb223cf7&base=a16dbf2100e6a1484a59cb41826034d01834b36d)
   - [qemu-intel64](https://membrowse.com/public/apache/nuttx/target/qemu-intel64/compare?head=52d4525022bded0cba8661f6448f277bdb223cf7&base=a16dbf2100e6a1484a59cb41826034d01834b36d)
   - [rx65n-rsk2mb](https://membrowse.com/public/apache/nuttx/target/rx65n-rsk2mb/compare?head=52d4525022bded0cba8661f6448f277bdb223cf7&base=a16dbf2100e6a1484a59cb41826034d01834b36d)
   - [s698pm-dkit](https://membrowse.com/public/apache/nuttx/target/s698pm-dkit/compare?head=52d4525022bded0cba8661f6448f277bdb223cf7&base=a16dbf2100e6a1484a59cb41826034d01834b36d)
   - [stm32-nucleo-f103rb](https://membrowse.com/public/apache/nuttx/target/stm32-nucleo-f103rb/compare?head=52d4525022bded0cba8661f6448f277bdb223cf7&base=a16dbf2100e6a1484a59cb41826034d01834b36d)
   
   ---
   <sub>Catch memory regressions in CI with [MemBrowse](https://membrowse.com). Free for open source.</sub>
   


-- 
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: commits-unsubscribe@nuttx.apache.org

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


Re: [PR] net/pkt: allocate send callback before queueing IOB [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #20859:
URL: https://github.com/apache/nuttx/pull/20859


-- 
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: commits-unsubscribe@nuttx.apache.org

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