]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: free msg->chunks when sctp_primitive_SEND return err
authorXin Long <lucien.xin@gmail.com>
Tue, 13 Sep 2016 18:04:20 +0000 (02:04 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Sep 2016 02:02:32 +0000 (22:02 -0400)
commit9d3076c6d488825efcf436cfc4d1176ca36da769
tree90a668733bd29a38dbbb939a5a241942b69501f3
parent2f69ce3eea778dc9981316880b33da1e1d9e0bc4
sctp: free msg->chunks when sctp_primitive_SEND return err

Last patch "sctp: do not return the transmit err back to sctp_sendmsg"
made sctp_primitive_SEND return err only when asoc state is unavailable.
In this case, chunks are not enqueued, they have no chance to be freed if
we don't take care of them later.

This Patch is actually to revert commit 9e1c7d845b23 ("sctp: remove the
unused sctp_datamsg_free()"), commit 8c881f62e220 ("sctp: hold the chunks
only after the chunk is enqueued in outq") and commit 8fbb6789c305 ("sctp:
only drop the reference on the datamsg after sending a msg"), to use
sctp_datamsg_free to free the chunks of current msg.

Fixes: 8fbb6789c305 ("sctp: only drop the reference on the datamsg after sending a msg")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/structs.h
net/sctp/chunk.c
net/sctp/outqueue.c
net/sctp/socket.c