diff options
-rw-r--r-- | drivers/md/md.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 2b4315d7e5d6..220e8e6fb7bb 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -33,6 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
36 | #include <linux/kernel.h> | ||
36 | #include <linux/kthread.h> | 37 | #include <linux/kthread.h> |
37 | #include <linux/linkage.h> | 38 | #include <linux/linkage.h> |
38 | #include <linux/raid/md.h> | 39 | #include <linux/raid/md.h> |
@@ -2637,8 +2638,7 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len) | |||
2637 | minor = simple_strtoul(buf, &e, 10); | 2638 | minor = simple_strtoul(buf, &e, 10); |
2638 | if (e==buf || (*e && *e != '\n') ) | 2639 | if (e==buf || (*e && *e != '\n') ) |
2639 | return -EINVAL; | 2640 | return -EINVAL; |
2640 | if (major >= sizeof(super_types)/sizeof(super_types[0]) || | 2641 | if (major >= ARRAY_SIZE(super_types) || super_types[major].name == NULL) |
2641 | super_types[major].name == NULL) | ||
2642 | return -ENOENT; | 2642 | return -ENOENT; |
2643 | mddev->major_version = major; | 2643 | mddev->major_version = major; |
2644 | mddev->minor_version = minor; | 2644 | mddev->minor_version = minor; |
@@ -4019,7 +4019,7 @@ static int set_array_info(mddev_t * mddev, mdu_array_info_t *info) | |||
4019 | if (info->raid_disks == 0) { | 4019 | if (info->raid_disks == 0) { |
4020 | /* just setting version number for superblock loading */ | 4020 | /* just setting version number for superblock loading */ |
4021 | if (info->major_version < 0 || | 4021 | if (info->major_version < 0 || |
4022 | info->major_version >= sizeof(super_types)/sizeof(super_types[0]) || | 4022 | info->major_version >= ARRAY_SIZE(super_types) || |
4023 | super_types[info->major_version].name == NULL) { | 4023 | super_types[info->major_version].name == NULL) { |
4024 | /* maybe try to auto-load a module? */ | 4024 | /* maybe try to auto-load a module? */ |
4025 | printk(KERN_INFO | 4025 | printk(KERN_INFO |