Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b884d25 authored by Al Viro's avatar Al Viro
Browse files

sel_write_validatetrans(): don't open-code memdup_user_nul()



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 2ea659a9
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -656,14 +656,12 @@ static ssize_t sel_write_validatetrans(struct file *file,
	if (*ppos != 0)
		goto out;

	rc = -ENOMEM;
	req = kzalloc(count + 1, GFP_KERNEL);
	if (!req)
		goto out;

	rc = -EFAULT;
	if (copy_from_user(req, buf, count))
	req = memdup_user_nul(buf, count);
	if (IS_ERR(req)) {
		rc = PTR_ERR(req);
		req = NULL;
		goto out;
	}

	rc = -ENOMEM;
	oldcon = kzalloc(count + 1, GFP_KERNEL);