mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
net/can: add write_q free for callback alloc error handling
Release the corresponding resources held when the alloc fails Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
This commit is contained in:
parent
99584588fc
commit
4fa74e4d18
1 changed files with 4 additions and 1 deletions
|
|
@ -378,7 +378,7 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
|
|||
|
||||
nerr("ERROR: Failed to allocate callback\n");
|
||||
ret = -ENOMEM;
|
||||
goto errout_with_wrb;
|
||||
goto errout_with_wq;
|
||||
}
|
||||
|
||||
/* Set up the callback in the connection */
|
||||
|
|
@ -407,6 +407,9 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
|
|||
errout_with_wrb:
|
||||
iob_free_chain(wb_iob);
|
||||
|
||||
errout_with_wq:
|
||||
iob_free_queue(&conn->write_q);
|
||||
|
||||
errout_with_lock:
|
||||
net_unlock();
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue