Skip to content

Commit

Permalink
perf_event_get(): don't bother with fget_raw()
Browse files Browse the repository at this point in the history
... since we immediately follow that with check that it *is* an
opened perf file, with O_PATH ones ending with with the same
-EBADF we'd get for descriptor that isn't opened at all.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jun 27, 2019
1 parent 8811249 commit 02e5ad9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -11554,9 +11554,7 @@ void perf_event_delayed_put(struct task_struct *task)

struct file *perf_event_get(unsigned int fd)
{
struct file *file;

file = fget_raw(fd);
struct file *file = fget(fd);
if (!file)
return ERR_PTR(-EBADF);

Expand Down

0 comments on commit 02e5ad9

Please sign in to comment.