diff --git a/[refs] b/[refs] index 5884c348744a..7924748d9d76 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9e58143dc08123c22c5b9f782b2913bd3a07a03d +refs/heads/master: 90d7404558fbe6f369d5e27b5ea3ef1e57562d3d diff --git a/trunk/mm/util.c b/trunk/mm/util.c index f5712e8964be..4735ea481816 100644 --- a/trunk/mm/util.c +++ b/trunk/mm/util.c @@ -225,15 +225,10 @@ char *strndup_user(const char __user *s, long n) if (length > n) return ERR_PTR(-EINVAL); - p = kmalloc(length, GFP_KERNEL); + p = memdup_user(s, length); - if (!p) - return ERR_PTR(-ENOMEM); - - if (copy_from_user(p, s, length)) { - kfree(p); - return ERR_PTR(-EFAULT); - } + if (IS_ERR(p)) + return p; p[length - 1] = '\0';