projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfe5c7b
)
HID: roccat: fix offset errors in bin_attribute read
author
Stefan Achatz
<erazor_de@users.sourceforge.net>
Sun, 20 Jun 2010 17:19:06 +0000
(19:19 +0200)
committer
Jiri Kosina
<jkosina@suse.cz>
Mon, 21 Jun 2010 12:04:39 +0000
(14:04 +0200)
Fixing wrong calculated offsets in bin_attribute read functions.
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-roccat-kone.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/hid/hid-roccat-kone.c
b/drivers/hid/hid-roccat-kone.c
index 0ab1df9d68ab45c9d5460d1a1cca23b9221ee394..2aef6e4caf43dddc335a8e92ecb9771ad127dd05 100644
(file)
--- a/
drivers/hid/hid-roccat-kone.c
+++ b/
drivers/hid/hid-roccat-kone.c
@@
-272,7
+272,7
@@
static ssize_t kone_sysfs_read_settings(struct file *fp, struct kobject *kobj,
count = sizeof(struct kone_settings) - off;
mutex_lock(&kone->kone_lock);
- memcpy(buf,
&kone->settings
+ off, count);
+ memcpy(buf,
((char const *)&kone->settings)
+ off, count);
mutex_unlock(&kone->kone_lock);
return count;
@@
-332,7
+332,7
@@
static ssize_t kone_sysfs_read_profilex(struct kobject *kobj,
count = sizeof(struct kone_profile) - off;
mutex_lock(&kone->kone_lock);
- memcpy(buf,
&kone->profiles[number - 1], sizeof(struct kone_profile)
);
+ memcpy(buf,
((char const *)&kone->profiles[number - 1]) + off, count
);
mutex_unlock(&kone->kone_lock);
return count;