projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fabb13d
)
ptp: oops in ptp_ioctl()
author
Dan Carpenter
<
[email protected]
>
Thu, 26 May 2016 06:46:22 +0000
(09:46 +0300)
committer
David S. Miller
<
[email protected]
>
Mon, 30 May 2016 05:32:27 +0000
(22:32 -0700)
If we pass ERR_PTR(-EFAULT) to kfree() then it's going to oops.
Fixes: 2ece068e1b1d ('ptp: use memdup_user().')
Signed-off-by: Dan Carpenter <
[email protected]
>
Acked-by: Richard Cochran <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/ptp/ptp_chardev.c
patch
|
blob
|
history
diff --git
a/drivers/ptp/ptp_chardev.c
b/drivers/ptp/ptp_chardev.c
index 0b1ac6be69ce8d2a73d58432badb7bf7262ad5b6..d637c933c8a90655ffe152101dda2b9c71fd3836 100644
(file)
--- a/
drivers/ptp/ptp_chardev.c
+++ b/
drivers/ptp/ptp_chardev.c
@@
-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) {