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 8953285 commit 080cbb8Copy full SHA for 080cbb8
net/tipc/msg.c
@@ -156,6 +156,11 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
156
if (!head)
157
goto err;
158
159
+ /* Either the input skb ownership is transferred to headskb
160
+ * or the input skb is freed, clear the reference to avoid
161
+ * bad access on error path.
162
+ */
163
+ *buf = NULL;
164
if (skb_try_coalesce(head, frag, &headstolen, &delta)) {
165
kfree_skb_partial(frag, headstolen);
166
} else {
@@ -179,7 +184,6 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
179
184
*headbuf = NULL;
180
185
return 1;
181
186
}
182
- *buf = NULL;
183
187
return 0;
188
err:
189
kfree_skb(*buf);
0 commit comments