diff options
Diffstat (limited to 'kernel/taskstats.c')
-rw-r--r-- | kernel/taskstats.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index 5eab1f3edfa5..610f0838d555 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
@@ -424,16 +424,15 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info) | |||
424 | struct nlattr *na; | 424 | struct nlattr *na; |
425 | size_t size; | 425 | size_t size; |
426 | u32 fd; | 426 | u32 fd; |
427 | struct file *file; | 427 | struct fd f; |
428 | int fput_needed; | ||
429 | 428 | ||
430 | na = info->attrs[CGROUPSTATS_CMD_ATTR_FD]; | 429 | na = info->attrs[CGROUPSTATS_CMD_ATTR_FD]; |
431 | if (!na) | 430 | if (!na) |
432 | return -EINVAL; | 431 | return -EINVAL; |
433 | 432 | ||
434 | fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]); | 433 | fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]); |
435 | file = fget_light(fd, &fput_needed); | 434 | f = fdget(fd); |
436 | if (!file) | 435 | if (!f.file) |
437 | return 0; | 436 | return 0; |
438 | 437 | ||
439 | size = nla_total_size(sizeof(struct cgroupstats)); | 438 | size = nla_total_size(sizeof(struct cgroupstats)); |
@@ -453,7 +452,7 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info) | |||
453 | stats = nla_data(na); | 452 | stats = nla_data(na); |
454 | memset(stats, 0, sizeof(*stats)); | 453 | memset(stats, 0, sizeof(*stats)); |
455 | 454 | ||
456 | rc = cgroupstats_build(stats, file->f_dentry); | 455 | rc = cgroupstats_build(stats, f.file->f_dentry); |
457 | if (rc < 0) { | 456 | if (rc < 0) { |
458 | nlmsg_free(rep_skb); | 457 | nlmsg_free(rep_skb); |
459 | goto err; | 458 | goto err; |
@@ -462,7 +461,7 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info) | |||
462 | rc = send_reply(rep_skb, info); | 461 | rc = send_reply(rep_skb, info); |
463 | 462 | ||
464 | err: | 463 | err: |
465 | fput_light(file, fput_needed); | 464 | fdput(f); |
466 | return rc; | 465 | return rc; |
467 | } | 466 | } |
468 | 467 | ||