diff options
Diffstat (limited to 'kernel/taskstats.c')
-rw-r--r-- | kernel/taskstats.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index f5f92014ae98..d9d7c3576238 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
@@ -416,7 +416,6 @@ err: | |||
416 | void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) | 416 | void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) |
417 | { | 417 | { |
418 | struct listener_list *listeners; | 418 | struct listener_list *listeners; |
419 | struct taskstats *tmp; | ||
420 | /* | 419 | /* |
421 | * This is the cpu on which the task is exiting currently and will | 420 | * This is the cpu on which the task is exiting currently and will |
422 | * be the one for which the exit event is sent, even if the cpu | 421 | * be the one for which the exit event is sent, even if the cpu |
@@ -424,19 +423,11 @@ void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) | |||
424 | */ | 423 | */ |
425 | *mycpu = raw_smp_processor_id(); | 424 | *mycpu = raw_smp_processor_id(); |
426 | 425 | ||
427 | *ptidstats = NULL; | ||
428 | tmp = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL); | ||
429 | if (!tmp) | ||
430 | return; | ||
431 | |||
432 | listeners = &per_cpu(listener_array, *mycpu); | 426 | listeners = &per_cpu(listener_array, *mycpu); |
433 | down_read(&listeners->sem); | 427 | |
434 | if (!list_empty(&listeners->list)) { | 428 | *ptidstats = NULL; |
435 | *ptidstats = tmp; | 429 | if (!list_empty(&listeners->list)) |
436 | tmp = NULL; | 430 | *ptidstats = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL); |
437 | } | ||
438 | up_read(&listeners->sem); | ||
439 | kfree(tmp); | ||
440 | } | 431 | } |
441 | 432 | ||
442 | /* Send pid data out on exit */ | 433 | /* Send pid data out on exit */ |