diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-31 18:51:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-31 18:51:00 -0400 |
commit | 0d6caa1795090bd22ede96b84daa4600b63eee37 (patch) | |
tree | 7b69aa68f7f812bd1a13b0c5e73573a01e671ef8 /net/tipc | |
parent | 88c8199b9d2f5ec0a8468a0495ba4c9656846500 (diff) | |
parent | 8072f085d79a0a73cc5a0333ffa7f0c5d35f76e0 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (41 commits)
[RTNETLINK]: Fix warning for !CONFIG_KMOD
[IPV4] ip_options.c: kmalloc + memset conversion to kzalloc
[DECNET]: kmalloc + memset conversion to kzalloc
[NET]: ethtool_perm_addr only has one implementation
[NET]: ethtool ops are the only way
[PPPOE]: Improve hashing function in hash_item().
[XFRM]: State selection update to use inner addresses.
[IPSEC]: Ensure that state inner family is set
[TCP]: Bidir flow must not disregard SACK blocks for lost marking
[TCP]: Fix ratehalving with bidirectional flows
[PPPOL2TP]: Add CONFIG_INET Kconfig dependency.
[NET]: Page offsets and lengths need to be __u32.
[AF_UNIX]: Make code static.
[NETFILTER]: Make nf_ct_ipv6_skip_exthdr() static.
[PKTGEN]: make get_ipsec_sa() static and non-inline
[PPPoE]: move lock_sock() in pppoe_sendmsg() to the right location
[PPPoX/E]: return ENOTTY on unknown ioctl requests
[IPV6]: ipv6_addr_type() doesn't know about RFC4193 addresses.
[NET]: Fix prio_tune() handling of root qdisc.
[NET]: Fix sch_api to properly set sch->parent on the root.
...
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/link.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 5adfdfd49d..1d674e0848 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -423,6 +423,17 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer, | |||
423 | return NULL; | 423 | return NULL; |
424 | } | 424 | } |
425 | 425 | ||
426 | if (LINK_LOG_BUF_SIZE) { | ||
427 | char *pb = kmalloc(LINK_LOG_BUF_SIZE, GFP_ATOMIC); | ||
428 | |||
429 | if (!pb) { | ||
430 | kfree(l_ptr); | ||
431 | warn("Link creation failed, no memory for print buffer\n"); | ||
432 | return NULL; | ||
433 | } | ||
434 | tipc_printbuf_init(&l_ptr->print_buf, pb, LINK_LOG_BUF_SIZE); | ||
435 | } | ||
436 | |||
426 | l_ptr->addr = peer; | 437 | l_ptr->addr = peer; |
427 | if_name = strchr(b_ptr->publ.name, ':') + 1; | 438 | if_name = strchr(b_ptr->publ.name, ':') + 1; |
428 | sprintf(l_ptr->name, "%u.%u.%u:%s-%u.%u.%u:", | 439 | sprintf(l_ptr->name, "%u.%u.%u:%s-%u.%u.%u:", |
@@ -432,8 +443,6 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer, | |||
432 | tipc_zone(peer), tipc_cluster(peer), tipc_node(peer)); | 443 | tipc_zone(peer), tipc_cluster(peer), tipc_node(peer)); |
433 | /* note: peer i/f is appended to link name by reset/activate */ | 444 | /* note: peer i/f is appended to link name by reset/activate */ |
434 | memcpy(&l_ptr->media_addr, media_addr, sizeof(*media_addr)); | 445 | memcpy(&l_ptr->media_addr, media_addr, sizeof(*media_addr)); |
435 | k_init_timer(&l_ptr->timer, (Handler)link_timeout, (unsigned long)l_ptr); | ||
436 | list_add_tail(&l_ptr->link_list, &b_ptr->links); | ||
437 | l_ptr->checkpoint = 1; | 446 | l_ptr->checkpoint = 1; |
438 | l_ptr->b_ptr = b_ptr; | 447 | l_ptr->b_ptr = b_ptr; |
439 | link_set_supervision_props(l_ptr, b_ptr->media->tolerance); | 448 | link_set_supervision_props(l_ptr, b_ptr->media->tolerance); |
@@ -459,21 +468,14 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer, | |||
459 | 468 | ||
460 | l_ptr->owner = tipc_node_attach_link(l_ptr); | 469 | l_ptr->owner = tipc_node_attach_link(l_ptr); |
461 | if (!l_ptr->owner) { | 470 | if (!l_ptr->owner) { |
471 | if (LINK_LOG_BUF_SIZE) | ||
472 | kfree(l_ptr->print_buf.buf); | ||
462 | kfree(l_ptr); | 473 | kfree(l_ptr); |
463 | return NULL; | 474 | return NULL; |
464 | } | 475 | } |
465 | 476 | ||
466 | if (LINK_LOG_BUF_SIZE) { | 477 | k_init_timer(&l_ptr->timer, (Handler)link_timeout, (unsigned long)l_ptr); |
467 | char *pb = kmalloc(LINK_LOG_BUF_SIZE, GFP_ATOMIC); | 478 | list_add_tail(&l_ptr->link_list, &b_ptr->links); |
468 | |||
469 | if (!pb) { | ||
470 | kfree(l_ptr); | ||
471 | warn("Link creation failed, no memory for print buffer\n"); | ||
472 | return NULL; | ||
473 | } | ||
474 | tipc_printbuf_init(&l_ptr->print_buf, pb, LINK_LOG_BUF_SIZE); | ||
475 | } | ||
476 | |||
477 | tipc_k_signal((Handler)tipc_link_start, (unsigned long)l_ptr); | 479 | tipc_k_signal((Handler)tipc_link_start, (unsigned long)l_ptr); |
478 | 480 | ||
479 | dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n", | 481 | dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n", |