summaryrefslogtreecommitdiffstats
path: root/drivers/char/dz.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/dz.c')
-rw-r--r--drivers/char/dz.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/dz.c b/drivers/char/dz.c
index a97d8a694..47918ce4a 100644
--- a/drivers/char/dz.c
+++ b/drivers/char/dz.c
@@ -847,10 +847,12 @@ static int set_serial_info (struct dz_serial *info, struct serial_struct *new_in
if (!new_info)
return -EFAULT;
- copy_from_user (&new_serial, new_info, sizeof(new_serial));
+ if(copy_from_user (&new_serial, new_info, sizeof(new_serial)))
+ return -EFAULT;
+
old_info = *info;
- if (!suser())
+ if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (info->count > 1)