diff options
-rw-r--r-- | block/partitions/efi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/partitions/efi.c b/block/partitions/efi.c index a8287b49d062..dc51f467a560 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c | |||
@@ -96,6 +96,7 @@ | |||
96 | * - Code works, detects all the partitions. | 96 | * - Code works, detects all the partitions. |
97 | * | 97 | * |
98 | ************************************************************/ | 98 | ************************************************************/ |
99 | #include <linux/kernel.h> | ||
99 | #include <linux/crc32.h> | 100 | #include <linux/crc32.h> |
100 | #include <linux/ctype.h> | 101 | #include <linux/ctype.h> |
101 | #include <linux/math64.h> | 102 | #include <linux/math64.h> |
@@ -715,8 +716,8 @@ int efi_partition(struct parsed_partitions *state) | |||
715 | efi_guid_unparse(&ptes[i].unique_partition_guid, info->uuid); | 716 | efi_guid_unparse(&ptes[i].unique_partition_guid, info->uuid); |
716 | 717 | ||
717 | /* Naively convert UTF16-LE to 7 bits. */ | 718 | /* Naively convert UTF16-LE to 7 bits. */ |
718 | label_max = min(sizeof(info->volname) - 1, | 719 | label_max = min(ARRAY_SIZE(info->volname) - 1, |
719 | sizeof(ptes[i].partition_name)); | 720 | ARRAY_SIZE(ptes[i].partition_name)); |
720 | info->volname[label_max] = 0; | 721 | info->volname[label_max] = 0; |
721 | while (label_count < label_max) { | 722 | while (label_count < label_max) { |
722 | u8 c = ptes[i].partition_name[label_count] & 0xff; | 723 | u8 c = ptes[i].partition_name[label_count] & 0xff; |