Commit e9708b41 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka
Browse files

drivers/autotune: do not read user data we should not expect



We receive the sampling period from the setup struct attached to the
AUTOTUNE_RTIOC_{IRQ,KERN,USER} requests, drop the last copy from user
from autotune_ioctl_nrt() which is spurious.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 02500eff
...@@ -644,7 +644,7 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned int request, void *ar ...@@ -644,7 +644,7 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned int request, void *ar
struct autotune_context *context; struct autotune_context *context;
struct autotune_setup setup; struct autotune_setup setup;
struct gravity_tuner *tuner; struct gravity_tuner *tuner;
int period, ret; int ret;
if (request == AUTOTUNE_RTIOC_RESET) { if (request == AUTOTUNE_RTIOC_RESET) {
xnclock_reset_gravity(&nkclock); xnclock_reset_gravity(&nkclock);
...@@ -678,10 +678,6 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned int request, void *ar ...@@ -678,10 +678,6 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned int request, void *ar
return -EINVAL; return -EINVAL;
} }
ret = rtdm_safe_copy_from_user(fd, &period, arg, sizeof(period));
if (ret)
return ret;
ret = tuner->init_tuner(tuner); ret = tuner->init_tuner(tuner);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
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