Merge tag 'thunderbolt-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next
Mika writes: thunderbolt: Changes for v5.7 merge window - A couple of commits that make the driver to use flexible-array member instead of zero-length array extension. This allows compiler to issue a warning if the flexible array is not the last member of a structure. - Use scnprintf() instead of snprintf() to avoid potential buffer overflow. * tag 'thunderbolt-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Use scnprintf() for avoiding potential buffer overflow thunderbolt: icm: Replace zero-length array with flexible-array member thunderbolt: eeprom: Replace zero-length array with flexible-array member
This commit is contained in:
@@ -147,10 +147,10 @@ static ssize_t boot_acl_show(struct device *dev, struct device_attribute *attr,
|
||||
|
||||
for (ret = 0, i = 0; i < tb->nboot_acl; i++) {
|
||||
if (!uuid_is_null(&uuids[i]))
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret, "%pUb",
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%pUb",
|
||||
&uuids[i]);
|
||||
|
||||
ret += snprintf(buf + ret, PAGE_SIZE - ret, "%s",
|
||||
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s",
|
||||
i < tb->nboot_acl - 1 ? "," : "\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ struct tb_drom_entry_header {
|
||||
|
||||
struct tb_drom_entry_generic {
|
||||
struct tb_drom_entry_header header;
|
||||
u8 data[0];
|
||||
u8 data[];
|
||||
} __packed;
|
||||
|
||||
struct tb_drom_entry_port {
|
||||
|
||||
@@ -114,7 +114,7 @@ struct icm_notification {
|
||||
struct ep_name_entry {
|
||||
u8 len;
|
||||
u8 type;
|
||||
u8 data[0];
|
||||
u8 data[];
|
||||
};
|
||||
|
||||
#define EP_NAME_INTEL_VSS 0x10
|
||||
|
||||
Reference in New Issue
Block a user