From: Dan Carpenter Date: Fri, 9 Jan 2015 12:32:31 +0000 (+0300) Subject: HID: roccat: potential out of bounds in pyra_sysfs_write_settings() X-Git-Tag: v3.2.67~57 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d70eb2623b85bcacac0a0ead54908d54a7789a50;p=pandora-kernel.git HID: roccat: potential out of bounds in pyra_sysfs_write_settings() commit 606185b20caf4c57d7e41e5a5ea4aff460aef2ab upstream. This is a static checker fix. We write some binary settings to the sysfs file. One of the settings is the "->startup_profile". There isn't any checking to make sure it fits into the pyra->profile_settings[] array in the profile_activated() function. I added a check to pyra_sysfs_write_settings() in both places because I wasn't positive that the other callers were correct. Signed-off-by: Dan Carpenter Signed-off-by: Jiri Kosina [bwh: Backported to 3.2: pyra_sysfs_write_settings() doesn't define a settings variable, so write the cast-expression inline] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed