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

Commit 6756325a authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

ptp: oops in ptp_ioctl()



If we pass ERR_PTR(-EFAULT) to kfree() then it's going to oops.

Fixes: 2ece068e ('ptp: use memdup_user().')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fabb13db
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
		sysoff = memdup_user((void __user *)arg, sizeof(*sysoff));
		if (IS_ERR(sysoff)) {
			err = PTR_ERR(sysoff);
			sysoff = NULL;
			break;
		}
		if (sysoff->n_samples > PTP_MAX_SAMPLES) {