aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/taskstats.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index 354e74bc17c1..07e86a828073 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -398,31 +398,31 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
398 398
399 fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]); 399 fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]);
400 file = fget_light(fd, &fput_needed); 400 file = fget_light(fd, &fput_needed);
401 if (file) { 401 if (!file)
402 size = nla_total_size(sizeof(struct cgroupstats)); 402 return 0;
403 403
404 rc = prepare_reply(info, CGROUPSTATS_CMD_NEW, &rep_skb, 404 size = nla_total_size(sizeof(struct cgroupstats));
405 size);
406 if (rc < 0)
407 goto err;
408 405
409 na = nla_reserve(rep_skb, CGROUPSTATS_TYPE_CGROUP_STATS, 406 rc = prepare_reply(info, CGROUPSTATS_CMD_NEW, &rep_skb,
410 sizeof(struct cgroupstats)); 407 size);
411 stats = nla_data(na); 408 if (rc < 0)
412 memset(stats, 0, sizeof(*stats)); 409 goto err;
413 410
414 rc = cgroupstats_build(stats, file->f_dentry); 411 na = nla_reserve(rep_skb, CGROUPSTATS_TYPE_CGROUP_STATS,
415 if (rc < 0) 412 sizeof(struct cgroupstats));
416 goto err; 413 stats = nla_data(na);
414 memset(stats, 0, sizeof(*stats));
417 415
418 fput_light(file, fput_needed); 416 rc = cgroupstats_build(stats, file->f_dentry);
419 return send_reply(rep_skb, info->snd_pid); 417 if (rc < 0) {
418 nlmsg_free(rep_skb);
419 goto err;
420 } 420 }
421 421
422 rc = send_reply(rep_skb, info->snd_pid);
423
422err: 424err:
423 if (file) 425 fput_light(file, fput_needed);
424 fput_light(file, fput_needed);
425 nlmsg_free(rep_skb);
426 return rc; 426 return rc;
427} 427}
428 428