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 <>
Acked-by: default avatarRichard Cochran <>
Signed-off-by: default avatarDavid S. Miller <>
parent fabb13db
......@@ -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;
if (sysoff->n_samples > PTP_MAX_SAMPLES) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment