diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2006-06-26 02:52:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-06-26 02:52:17 -0400 |
commit | a10bd924a421e0e5d5bb9640735b9317b8e473b5 (patch) | |
tree | d86ac98e60292c3197a8f6ef9af86549dd051102 /net/tipc/subscr.c | |
parent | f131072c3da84e70a0f65d71b3a3f6611c6a22bc (diff) |
[TIPC]: Enhanced & cleaned up system messages; fixed 2 obscure memory leaks.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/subscr.c')
-rw-r--r-- | net/tipc/subscr.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index c5f026c7fd38..fc171875660c 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c | |||
@@ -266,7 +266,8 @@ static void subscr_subscribe(struct tipc_subscr *s, | |||
266 | /* Refuse subscription if global limit exceeded */ | 266 | /* Refuse subscription if global limit exceeded */ |
267 | 267 | ||
268 | if (atomic_read(&topsrv.subscription_count) >= tipc_max_subscriptions) { | 268 | if (atomic_read(&topsrv.subscription_count) >= tipc_max_subscriptions) { |
269 | warn("Failed: max %u subscriptions\n", tipc_max_subscriptions); | 269 | warn("Subscription rejected, subscription limit reached (%u)\n", |
270 | tipc_max_subscriptions); | ||
270 | subscr_terminate(subscriber); | 271 | subscr_terminate(subscriber); |
271 | return; | 272 | return; |
272 | } | 273 | } |
@@ -274,8 +275,8 @@ static void subscr_subscribe(struct tipc_subscr *s, | |||
274 | /* Allocate subscription object */ | 275 | /* Allocate subscription object */ |
275 | 276 | ||
276 | sub = kmalloc(sizeof(*sub), GFP_ATOMIC); | 277 | sub = kmalloc(sizeof(*sub), GFP_ATOMIC); |
277 | if (sub == NULL) { | 278 | if (!sub) { |
278 | warn("Memory squeeze; ignoring subscription\n"); | 279 | warn("Subscription rejected, no memory\n"); |
279 | subscr_terminate(subscriber); | 280 | subscr_terminate(subscriber); |
280 | return; | 281 | return; |
281 | } | 282 | } |
@@ -298,8 +299,7 @@ static void subscr_subscribe(struct tipc_subscr *s, | |||
298 | if ((((sub->filter != TIPC_SUB_PORTS) | 299 | if ((((sub->filter != TIPC_SUB_PORTS) |
299 | && (sub->filter != TIPC_SUB_SERVICE))) | 300 | && (sub->filter != TIPC_SUB_SERVICE))) |
300 | || (sub->seq.lower > sub->seq.upper)) { | 301 | || (sub->seq.lower > sub->seq.upper)) { |
301 | warn("Rejecting illegal subscription %u,%u,%u\n", | 302 | warn("Subscription rejected, illegal request\n"); |
302 | sub->seq.type, sub->seq.lower, sub->seq.upper); | ||
303 | kfree(sub); | 303 | kfree(sub); |
304 | subscr_terminate(subscriber); | 304 | subscr_terminate(subscriber); |
305 | return; | 305 | return; |
@@ -387,7 +387,7 @@ static void subscr_named_msg_event(void *usr_handle, | |||
387 | dbg("subscr_named_msg_event: orig = %x own = %x,\n", | 387 | dbg("subscr_named_msg_event: orig = %x own = %x,\n", |
388 | orig->node, tipc_own_addr); | 388 | orig->node, tipc_own_addr); |
389 | if (size && (size != sizeof(struct tipc_subscr))) { | 389 | if (size && (size != sizeof(struct tipc_subscr))) { |
390 | warn("Received tipc_subscr of invalid size\n"); | 390 | warn("Subscriber rejected, invalid subscription size\n"); |
391 | return; | 391 | return; |
392 | } | 392 | } |
393 | 393 | ||
@@ -395,7 +395,7 @@ static void subscr_named_msg_event(void *usr_handle, | |||
395 | 395 | ||
396 | subscriber = kmalloc(sizeof(struct subscriber), GFP_ATOMIC); | 396 | subscriber = kmalloc(sizeof(struct subscriber), GFP_ATOMIC); |
397 | if (subscriber == NULL) { | 397 | if (subscriber == NULL) { |
398 | warn("Memory squeeze; ignoring subscriber setup\n"); | 398 | warn("Subscriber rejected, no memory\n"); |
399 | return; | 399 | return; |
400 | } | 400 | } |
401 | memset(subscriber, 0, sizeof(struct subscriber)); | 401 | memset(subscriber, 0, sizeof(struct subscriber)); |
@@ -403,7 +403,7 @@ static void subscr_named_msg_event(void *usr_handle, | |||
403 | INIT_LIST_HEAD(&subscriber->subscriber_list); | 403 | INIT_LIST_HEAD(&subscriber->subscriber_list); |
404 | subscriber->ref = tipc_ref_acquire(subscriber, &subscriber->lock); | 404 | subscriber->ref = tipc_ref_acquire(subscriber, &subscriber->lock); |
405 | if (subscriber->ref == 0) { | 405 | if (subscriber->ref == 0) { |
406 | warn("Failed to acquire subscriber reference\n"); | 406 | warn("Subscriber rejected, reference table exhausted\n"); |
407 | kfree(subscriber); | 407 | kfree(subscriber); |
408 | return; | 408 | return; |
409 | } | 409 | } |
@@ -422,7 +422,7 @@ static void subscr_named_msg_event(void *usr_handle, | |||
422 | NULL, | 422 | NULL, |
423 | &subscriber->port_ref); | 423 | &subscriber->port_ref); |
424 | if (subscriber->port_ref == 0) { | 424 | if (subscriber->port_ref == 0) { |
425 | warn("Memory squeeze; failed to create subscription port\n"); | 425 | warn("Subscriber rejected, unable to create port\n"); |
426 | tipc_ref_discard(subscriber->ref); | 426 | tipc_ref_discard(subscriber->ref); |
427 | kfree(subscriber); | 427 | kfree(subscriber); |
428 | return; | 428 | return; |