diff options
Diffstat (limited to 'drivers/char/random.c')
-rw-r--r-- | drivers/char/random.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index 46944088cf94..964d78d31578 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1062,8 +1062,7 @@ static ssize_t random_write(struct file *file, const char __user *buffer, | |||
1062 | return (ssize_t)count; | 1062 | return (ssize_t)count; |
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | static int random_ioctl(struct inode *inode, struct file *file, | 1065 | static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg) |
1066 | unsigned int cmd, unsigned long arg) | ||
1067 | { | 1066 | { |
1068 | int size, ent_count; | 1067 | int size, ent_count; |
1069 | int __user *p = (int __user *)arg; | 1068 | int __user *p = (int __user *)arg; |
@@ -1071,8 +1070,8 @@ static int random_ioctl(struct inode *inode, struct file *file, | |||
1071 | 1070 | ||
1072 | switch (cmd) { | 1071 | switch (cmd) { |
1073 | case RNDGETENTCNT: | 1072 | case RNDGETENTCNT: |
1074 | ent_count = input_pool.entropy_count; | 1073 | /* inherently racy, no point locking */ |
1075 | if (put_user(ent_count, p)) | 1074 | if (put_user(input_pool.entropy_count, p)) |
1076 | return -EFAULT; | 1075 | return -EFAULT; |
1077 | return 0; | 1076 | return 0; |
1078 | case RNDADDTOENTCNT: | 1077 | case RNDADDTOENTCNT: |
@@ -1115,13 +1114,13 @@ const struct file_operations random_fops = { | |||
1115 | .read = random_read, | 1114 | .read = random_read, |
1116 | .write = random_write, | 1115 | .write = random_write, |
1117 | .poll = random_poll, | 1116 | .poll = random_poll, |
1118 | .ioctl = random_ioctl, | 1117 | .unlocked_ioctl = random_ioctl, |
1119 | }; | 1118 | }; |
1120 | 1119 | ||
1121 | const struct file_operations urandom_fops = { | 1120 | const struct file_operations urandom_fops = { |
1122 | .read = urandom_read, | 1121 | .read = urandom_read, |
1123 | .write = random_write, | 1122 | .write = random_write, |
1124 | .ioctl = random_ioctl, | 1123 | .unlocked_ioctl = random_ioctl, |
1125 | }; | 1124 | }; |
1126 | 1125 | ||
1127 | /*************************************************************** | 1126 | /*************************************************************** |