diff options
-rw-r--r-- | drivers/input/joystick/warrior.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/kbtab.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/wacom.c | 2 | ||||
-rw-r--r-- | fs/proc/generic.c | 47 | ||||
-rw-r--r-- | kernel/sysctl.c | 6 |
5 files changed, 28 insertions, 31 deletions
diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c index 99a642d2a1fe..1849b176cf18 100644 --- a/drivers/input/joystick/warrior.c +++ b/drivers/input/joystick/warrior.c | |||
@@ -172,7 +172,7 @@ static int warrior_connect(struct serio *serio, struct serio_driver *drv) | |||
172 | input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 8); | 172 | input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 8); |
173 | input_set_abs_params(input_dev, ABS_THROTTLE, -112, 112, 0, 0); | 173 | input_set_abs_params(input_dev, ABS_THROTTLE, -112, 112, 0, 0); |
174 | input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0); | 174 | input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0); |
175 | input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0); | 175 | input_set_abs_params(input_dev, ABS_HAT0Y, -1, 1, 0, 0); |
176 | 176 | ||
177 | serio_set_drvdata(serio, warrior); | 177 | serio_set_drvdata(serio, warrior); |
178 | 178 | ||
diff --git a/drivers/usb/input/kbtab.c b/drivers/usb/input/kbtab.c index a248664b5d1d..fd48e74e78ed 100644 --- a/drivers/usb/input/kbtab.c +++ b/drivers/usb/input/kbtab.c | |||
@@ -159,7 +159,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
159 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH); | 159 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH); |
160 | input_dev->mscbit[0] |= BIT(MSC_SERIAL); | 160 | input_dev->mscbit[0] |= BIT(MSC_SERIAL); |
161 | input_set_abs_params(input_dev, ABS_X, 0, 0x2000, 4, 0); | 161 | input_set_abs_params(input_dev, ABS_X, 0, 0x2000, 4, 0); |
162 | input_set_abs_params(input_dev, ABS_X, 0, 0x1750, 4, 0); | 162 | input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0); |
163 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0); | 163 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0); |
164 | 164 | ||
165 | endpoint = &intf->cur_altsetting->endpoint[0].desc; | 165 | endpoint = &intf->cur_altsetting->endpoint[0].desc; |
diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index aea1cfae34cc..dc099bbe12bf 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c | |||
@@ -854,7 +854,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
854 | 854 | ||
855 | input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS); | 855 | input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS); |
856 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS); | 856 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS); |
857 | input_set_abs_params(input_dev, ABS_X, 0, wacom->features->y_max, 4, 0); | 857 | input_set_abs_params(input_dev, ABS_X, 0, wacom->features->x_max, 4, 0); |
858 | input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0); | 858 | input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0); |
859 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0); | 859 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0); |
860 | 860 | ||
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index b638fb500743..72b431d0a0a4 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -54,6 +54,18 @@ proc_file_read(struct file *file, char __user *buf, size_t nbytes, | |||
54 | ssize_t n, count; | 54 | ssize_t n, count; |
55 | char *start; | 55 | char *start; |
56 | struct proc_dir_entry * dp; | 56 | struct proc_dir_entry * dp; |
57 | unsigned long long pos; | ||
58 | |||
59 | /* | ||
60 | * Gaah, please just use "seq_file" instead. The legacy /proc | ||
61 | * interfaces cut loff_t down to off_t for reads, and ignore | ||
62 | * the offset entirely for writes.. | ||
63 | */ | ||
64 | pos = *ppos; | ||
65 | if (pos > MAX_NON_LFS) | ||
66 | return 0; | ||
67 | if (nbytes > MAX_NON_LFS - pos) | ||
68 | nbytes = MAX_NON_LFS - pos; | ||
57 | 69 | ||
58 | dp = PDE(inode); | 70 | dp = PDE(inode); |
59 | if (!(page = (char*) __get_free_page(GFP_KERNEL))) | 71 | if (!(page = (char*) __get_free_page(GFP_KERNEL))) |
@@ -202,30 +214,17 @@ proc_file_write(struct file *file, const char __user *buffer, | |||
202 | static loff_t | 214 | static loff_t |
203 | proc_file_lseek(struct file *file, loff_t offset, int orig) | 215 | proc_file_lseek(struct file *file, loff_t offset, int orig) |
204 | { | 216 | { |
205 | lock_kernel(); | 217 | loff_t retval = -EINVAL; |
206 | 218 | switch (orig) { | |
207 | switch (orig) { | 219 | case 1: |
208 | case 0: | 220 | offset += file->f_pos; |
209 | if (offset < 0) | 221 | /* fallthrough */ |
210 | goto out; | 222 | case 0: |
211 | file->f_pos = offset; | 223 | if (offset < 0 || offset > MAX_NON_LFS) |
212 | unlock_kernel(); | 224 | break; |
213 | return(file->f_pos); | 225 | file->f_pos = retval = offset; |
214 | case 1: | 226 | } |
215 | if (offset + file->f_pos < 0) | 227 | return retval; |
216 | goto out; | ||
217 | file->f_pos += offset; | ||
218 | unlock_kernel(); | ||
219 | return(file->f_pos); | ||
220 | case 2: | ||
221 | goto out; | ||
222 | default: | ||
223 | goto out; | ||
224 | } | ||
225 | |||
226 | out: | ||
227 | unlock_kernel(); | ||
228 | return -EINVAL; | ||
229 | } | 228 | } |
230 | 229 | ||
231 | static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) | 230 | static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 9990e10192e8..e5102ea6e104 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -2201,14 +2201,12 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen, | |||
2201 | if (get_user(len, oldlenp)) | 2201 | if (get_user(len, oldlenp)) |
2202 | return -EFAULT; | 2202 | return -EFAULT; |
2203 | if (len) { | 2203 | if (len) { |
2204 | l = strlen(table->data); | 2204 | l = strlen(table->data)+1; |
2205 | if (len > l) len = l; | 2205 | if (len > l) len = l; |
2206 | if (len >= table->maxlen) | 2206 | if (len >= table->maxlen) |
2207 | len = table->maxlen; | 2207 | len = table->maxlen; |
2208 | if(copy_to_user(oldval, table->data, len)) | 2208 | if(copy_to_user(oldval, table->data, len)) |
2209 | return -EFAULT; | 2209 | return -EFAULT; |
2210 | if(put_user(0, ((char __user *) oldval) + len)) | ||
2211 | return -EFAULT; | ||
2212 | if(put_user(len, oldlenp)) | 2210 | if(put_user(len, oldlenp)) |
2213 | return -EFAULT; | 2211 | return -EFAULT; |
2214 | } | 2212 | } |
@@ -2223,7 +2221,7 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen, | |||
2223 | len--; | 2221 | len--; |
2224 | ((char *) table->data)[len] = 0; | 2222 | ((char *) table->data)[len] = 0; |
2225 | } | 2223 | } |
2226 | return 0; | 2224 | return 1; |
2227 | } | 2225 | } |
2228 | 2226 | ||
2229 | /* | 2227 | /* |