mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
grub_dmraid_nv_detect: Do not divide by zero.
This commit is contained in:
1 parent
98f74998d5
commit
935863518f
2 files changed
+11
No files matched your search
@@ -1,3 +1,8 @@
|
||||
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Do not
|
||||
divide by zero.
|
||||
|
||||
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/fs/hfs.c (grub_hfs_mount): Additional filesystem
|
||||
|
||||
@@ -129,6 +129,9 @@ grub_dmraid_nv_detect (grub_disk_t disk,
|
||||
case NV_LEVEL_0:
|
||||
level = 0;
|
||||
disk_size = sb.capacity / sb.array.total_volumes;
|
||||
if (sb.array.total_volumes == 0)
|
||||
/* Not RAID. */
|
||||
return NULL;
|
||||
break;
|
||||
|
||||
case NV_LEVEL_1:
|
||||
@@ -139,6 +142,9 @@ grub_dmraid_nv_detect (grub_disk_t disk,
|
||||
case NV_LEVEL_5:
|
||||
level = 5;
|
||||
disk_size = sb.capacity / (sb.array.total_volumes - 1);
|
||||
if (sb.array.total_volumes == 0 || sb.array.total_volumes == 1)
|
||||
/* Not RAID. */
|
||||
return NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user