Commit cab6b16a authored by Stefan Achatz's avatar Stefan Achatz Committed by Jiri Kosina

HID: roccat: fix offset errors in bin_attribute read

Fixing wrong calculated offsets in bin_attribute read functions.
Signed-off-by: default avatarStefan Achatz <erazor_de@users.sourceforge.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent dfe5c7b7
...@@ -272,7 +272,7 @@ static ssize_t kone_sysfs_read_settings(struct file *fp, struct kobject *kobj, ...@@ -272,7 +272,7 @@ static ssize_t kone_sysfs_read_settings(struct file *fp, struct kobject *kobj,
count = sizeof(struct kone_settings) - off; count = sizeof(struct kone_settings) - off;
mutex_lock(&kone->kone_lock); mutex_lock(&kone->kone_lock);
memcpy(buf, &kone->settings + off, count); memcpy(buf, ((char const *)&kone->settings) + off, count);
mutex_unlock(&kone->kone_lock); mutex_unlock(&kone->kone_lock);
return count; return count;
...@@ -332,7 +332,7 @@ static ssize_t kone_sysfs_read_profilex(struct kobject *kobj, ...@@ -332,7 +332,7 @@ static ssize_t kone_sysfs_read_profilex(struct kobject *kobj,
count = sizeof(struct kone_profile) - off; count = sizeof(struct kone_profile) - off;
mutex_lock(&kone->kone_lock); 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); mutex_unlock(&kone->kone_lock);
return count; return count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment