aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/msg.c')
-rw-r--r--net/tipc/msg.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 6ec958401f78..ce6d929d66d2 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -96,9 +96,11 @@ int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect,
96} 96}
97 97
98/* tipc_buf_append(): Append a buffer to the fragment list of another buffer 98/* tipc_buf_append(): Append a buffer to the fragment list of another buffer
99 * Let first buffer become head buffer 99 * @*headbuf: in: NULL for first frag, otherwise value returned from prev call
100 * Returns 1 and sets *buf to headbuf if chain is complete, otherwise 0 100 * out: set when successful non-complete reassembly, otherwise NULL
101 * Leaves headbuf pointer at NULL if failure 101 * @*buf: in: the buffer to append. Always defined
102 * out: head buf after sucessful complete reassembly, otherwise NULL
103 * Returns 1 when reassembly complete, otherwise 0
102 */ 104 */
103int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf) 105int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
104{ 106{
@@ -117,6 +119,7 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
117 goto out_free; 119 goto out_free;
118 head = *headbuf = frag; 120 head = *headbuf = frag;
119 skb_frag_list_init(head); 121 skb_frag_list_init(head);
122 *buf = NULL;
120 return 0; 123 return 0;
121 } 124 }
122 if (!head) 125 if (!head)
@@ -145,6 +148,8 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
145out_free: 148out_free:
146 pr_warn_ratelimited("Unable to build fragment list\n"); 149 pr_warn_ratelimited("Unable to build fragment list\n");
147 kfree_skb(*buf); 150 kfree_skb(*buf);
151 kfree_skb(*headbuf);
152 *buf = *headbuf = NULL;
148 return 0; 153 return 0;
149} 154}
150 155