sel_write_validatetrans(): don't open-code memdup_user_nul()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
2ea659a9ef
commit
0b884d25f5
|
@ -656,14 +656,12 @@ static ssize_t sel_write_validatetrans(struct file *file,
|
||||||
if (*ppos != 0)
|
if (*ppos != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
rc = -ENOMEM;
|
req = memdup_user_nul(buf, count);
|
||||||
req = kzalloc(count + 1, GFP_KERNEL);
|
if (IS_ERR(req)) {
|
||||||
if (!req)
|
rc = PTR_ERR(req);
|
||||||
goto out;
|
req = NULL;
|
||||||
|
|
||||||
rc = -EFAULT;
|
|
||||||
if (copy_from_user(req, buf, count))
|
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
oldcon = kzalloc(count + 1, GFP_KERNEL);
|
oldcon = kzalloc(count + 1, GFP_KERNEL);
|
||||||
|
|
Loading…
Reference in New Issue