aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/taskstats.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/taskstats.c')
-rw-r--r--kernel/taskstats.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index d0a32796550f..5116b7e5962e 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -415,16 +415,15 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
415 struct nlattr *na; 415 struct nlattr *na;
416 size_t size; 416 size_t size;
417 u32 fd; 417 u32 fd;
418 struct file *file; 418 struct fd f;
419 int fput_needed;
420 419
421 na = info->attrs[CGROUPSTATS_CMD_ATTR_FD]; 420 na = info->attrs[CGROUPSTATS_CMD_ATTR_FD];
422 if (!na) 421 if (!na)
423 return -EINVAL; 422 return -EINVAL;
424 423
425 fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]); 424 fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]);
426 file = fget_light(fd, &fput_needed); 425 f = fdget(fd);
427 if (!file) 426 if (!f.file)
428 return 0; 427 return 0;
429 428
430 size = nla_total_size(sizeof(struct cgroupstats)); 429 size = nla_total_size(sizeof(struct cgroupstats));
@@ -444,7 +443,7 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
444 stats = nla_data(na); 443 stats = nla_data(na);
445 memset(stats, 0, sizeof(*stats)); 444 memset(stats, 0, sizeof(*stats));
446 445
447 rc = cgroupstats_build(stats, file->f_dentry); 446 rc = cgroupstats_build(stats, f.file->f_dentry);
448 if (rc < 0) { 447 if (rc < 0) {
449 nlmsg_free(rep_skb); 448 nlmsg_free(rep_skb);
450 goto err; 449 goto err;
@@ -453,7 +452,7 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
453 rc = send_reply(rep_skb, info); 452 rc = send_reply(rep_skb, info);
454 453
455err: 454err:
456 fput_light(file, fput_needed); 455 fdput(f);
457 return rc; 456 return rc;
458} 457}
459 458