hid: roccat-kone: fix off-by-one bug in attributes
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Aug 2013 04:56:46 +0000 (21:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Aug 2013 04:56:46 +0000 (21:56 -0700)
Stefan pointed out that I messed up the array for the binary attributes,
so fix it properly.

Reported-by: Stefan Achatz <erazor_de@users.sourceforge.net>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-roccat-kone.c

index 5eddf834c05cc19231b7917951be7d2d86d9155c..6e614a85f1758618f13f7dd59a76f6871bb93805 100644 (file)
@@ -386,7 +386,7 @@ static struct bin_attribute bin_attr_profile##number = {    \
        .size = sizeof(struct kone_profile),                    \
        .read = kone_sysfs_read_profilex,                       \
        .write = kone_sysfs_write_profilex,                     \
-       .private = &profile_numbers[number],                    \
+       .private = &profile_numbers[number-1],                  \
 };
 PROFILE_ATTR(1);
 PROFILE_ATTR(2);