diff options
author | Stefan Achatz <erazor_de@users.sourceforge.net> | 2011-01-06 09:00:41 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-01-20 11:28:53 +0100 |
commit | fd82be6c0a359fc706a805a49b1f167af21e63ea (patch) | |
tree | f2a8a29ed69630ce0a36639e7a221d7c6a91de4e | |
parent | e68cc603b063416c85f3e408184219fb71d4a9ff (diff) | |
download | op-kernel-dev-fd82be6c0a359fc706a805a49b1f167af21e63ea.zip op-kernel-dev-fd82be6c0a359fc706a805a49b1f167af21e63ea.tar.gz |
HID: roccat: Fix an error message when reading more data from bin attributes
Using cat or something to read from binary attributes would try to do an
additional read with offset equal to filesize. This resulted in an invalid
attribute error. This is fixed by giving the right answer instead of EINVAL.
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/hid-roccat-koneplus.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index 591a97c..65d7cde 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c @@ -258,6 +258,9 @@ static ssize_t koneplus_sysfs_read(struct file *fp, struct kobject *kobj, struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev)); int retval; + if (off >= real_size) + return 0; + if (off != 0 || count != real_size) return -EINVAL; |