Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63392
b: refs/heads/master
c: 9457106
h: refs/heads/master
v: v3
  • Loading branch information
Florian Westphal authored and David S. Miller committed Jul 31, 2007
1 parent f0a38c9 commit 61d2099
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ed72ec4afb9fbd584e03763707d3db0f62ee1be
refs/heads/master: 94571065757a4f2619c48ab4e36cafdc635028ce
28 changes: 15 additions & 13 deletions trunk/net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,17 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer,
return NULL;
}

if (LINK_LOG_BUF_SIZE) {
char *pb = kmalloc(LINK_LOG_BUF_SIZE, GFP_ATOMIC);

if (!pb) {
kfree(l_ptr);
warn("Link creation failed, no memory for print buffer\n");
return NULL;
}
tipc_printbuf_init(&l_ptr->print_buf, pb, LINK_LOG_BUF_SIZE);
}

l_ptr->addr = peer;
if_name = strchr(b_ptr->publ.name, ':') + 1;
sprintf(l_ptr->name, "%u.%u.%u:%s-%u.%u.%u:",
Expand All @@ -432,8 +443,6 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer,
tipc_zone(peer), tipc_cluster(peer), tipc_node(peer));
/* note: peer i/f is appended to link name by reset/activate */
memcpy(&l_ptr->media_addr, media_addr, sizeof(*media_addr));
k_init_timer(&l_ptr->timer, (Handler)link_timeout, (unsigned long)l_ptr);
list_add_tail(&l_ptr->link_list, &b_ptr->links);
l_ptr->checkpoint = 1;
l_ptr->b_ptr = b_ptr;
link_set_supervision_props(l_ptr, b_ptr->media->tolerance);
Expand All @@ -459,21 +468,14 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer,

l_ptr->owner = tipc_node_attach_link(l_ptr);
if (!l_ptr->owner) {
if (LINK_LOG_BUF_SIZE)
kfree(l_ptr->print_buf.buf);
kfree(l_ptr);
return NULL;
}

if (LINK_LOG_BUF_SIZE) {
char *pb = kmalloc(LINK_LOG_BUF_SIZE, GFP_ATOMIC);

if (!pb) {
kfree(l_ptr);
warn("Link creation failed, no memory for print buffer\n");
return NULL;
}
tipc_printbuf_init(&l_ptr->print_buf, pb, LINK_LOG_BUF_SIZE);
}

k_init_timer(&l_ptr->timer, (Handler)link_timeout, (unsigned long)l_ptr);
list_add_tail(&l_ptr->link_list, &b_ptr->links);
tipc_k_signal((Handler)tipc_link_start, (unsigned long)l_ptr);

dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n",
Expand Down

0 comments on commit 61d2099

Please sign in to comment.