Skip to content

Commit

Permalink
memdup_user(): switch to GFP_USER
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jan 7, 2018
1 parent 105f2b7 commit 6c2c97a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions mm/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,7 @@ void *memdup_user(const void __user *src, size_t len)
{
void *p;

/*
* Always use GFP_KERNEL, since copy_from_user() can sleep and
* cause pagefault, which makes it pointless to use GFP_NOFS
* or GFP_ATOMIC.
*/
p = kmalloc_track_caller(len, GFP_KERNEL);
p = kmalloc_track_caller(len, GFP_USER);
if (!p)
return ERR_PTR(-ENOMEM);

Expand Down

0 comments on commit 6c2c97a

Please sign in to comment.