diff options
-rw-r--r-- | net/tipc/msg.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/tipc/msg.c b/net/tipc/msg.c index 8be6e94a1ca9..0a37a472c29f 100644 --- a/net/tipc/msg.c +++ b/net/tipc/msg.c | |||
@@ -101,9 +101,11 @@ int tipc_msg_build(struct tipc_msg *hdr, struct iovec const *msg_sect, | |||
101 | } | 101 | } |
102 | 102 | ||
103 | /* tipc_buf_append(): Append a buffer to the fragment list of another buffer | 103 | /* tipc_buf_append(): Append a buffer to the fragment list of another buffer |
104 | * Let first buffer become head buffer | 104 | * @*headbuf: in: NULL for first frag, otherwise value returned from prev call |
105 | * Returns 1 and sets *buf to headbuf if chain is complete, otherwise 0 | 105 | * out: set when successful non-complete reassembly, otherwise NULL |
106 | * Leaves headbuf pointer at NULL if failure | 106 | * @*buf: in: the buffer to append. Always defined |
107 | * out: head buf after sucessful complete reassembly, otherwise NULL | ||
108 | * Returns 1 when reassembly complete, otherwise 0 | ||
107 | */ | 109 | */ |
108 | int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf) | 110 | int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf) |
109 | { | 111 | { |
@@ -122,6 +124,7 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf) | |||
122 | goto out_free; | 124 | goto out_free; |
123 | head = *headbuf = frag; | 125 | head = *headbuf = frag; |
124 | skb_frag_list_init(head); | 126 | skb_frag_list_init(head); |
127 | *buf = NULL; | ||
125 | return 0; | 128 | return 0; |
126 | } | 129 | } |
127 | if (!head) | 130 | if (!head) |
@@ -150,5 +153,7 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf) | |||
150 | out_free: | 153 | out_free: |
151 | pr_warn_ratelimited("Unable to build fragment list\n"); | 154 | pr_warn_ratelimited("Unable to build fragment list\n"); |
152 | kfree_skb(*buf); | 155 | kfree_skb(*buf); |
156 | kfree_skb(*headbuf); | ||
157 | *buf = *headbuf = NULL; | ||
153 | return 0; | 158 | return 0; |
154 | } | 159 | } |