We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 286db31 commit 37583b9Copy full SHA for 37583b9
net/tipc/msg.c
@@ -162,6 +162,11 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
162
if (!head)
163
goto err;
164
165
+ /* Either the input skb ownership is transferred to headskb
166
+ * or the input skb is freed, clear the reference to avoid
167
+ * bad access on error path.
168
+ */
169
+ *buf = NULL;
170
if (skb_try_coalesce(head, frag, &headstolen, &delta)) {
171
kfree_skb_partial(frag, headstolen);
172
} else {
@@ -185,7 +190,6 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
185
190
*headbuf = NULL;
186
191
return 1;
187
192
}
188
- *buf = NULL;
189
193
return 0;
194
err:
195
kfree_skb(*buf);
0 commit comments