]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: make tipc_buf_append() more robust
authorJon Paul Maloy <jon.maloy@ericsson.com>
Fri, 25 Jul 2014 18:48:09 +0000 (14:48 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Jul 2014 01:34:01 +0000 (18:34 -0700)
commit0fe5910da75746f30994671e1bcbd78f4a04e307
treec028b77384eec9c472b2a11bd41c3fa70d65e93a
parente0d4362eb3b7f94094962fd71fe154c35a9dc644
tipc: make tipc_buf_append() more robust

As per comment from David Miller, we try to make the buffer reassembly
function more resilient to user errors than it is today.

- We check that the "*buf" parameter always is set, since this is
  mandatory input.

- We ensure that *buf->next always is set to NULL before linking in
  the buffer, instead of relying of the caller to have done this.

- We ensure that the "tail" pointer in the head buffer's control
  block is initialized to NULL when the first fragment arrives.

Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/msg.c