forked from luck/tmp_suning_uos_patched
ptp: oops in ptp_ioctl()
If we pass ERR_PTR(-EFAULT) to kfree() then it's going to oops.
Fixes: 2ece068e1b
('ptp: use memdup_user().')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fabb13db44
commit
6756325a9a
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user