Commit 93586351 authored by Vladimir Serbinenko's avatar Vladimir Serbinenko
Browse files

grub_dmraid_nv_detect: Do not divide by zero.

parent 98f74998
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> 2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
   
* grub-core/fs/hfs.c (grub_hfs_mount): Additional filesystem * grub-core/fs/hfs.c (grub_hfs_mount): Additional filesystem
...@@ -129,6 +129,9 @@ grub_dmraid_nv_detect (grub_disk_t disk, ...@@ -129,6 +129,9 @@ grub_dmraid_nv_detect (grub_disk_t disk,
case NV_LEVEL_0: case NV_LEVEL_0:
level = 0; level = 0;
disk_size = sb.capacity / sb.array.total_volumes; disk_size = sb.capacity / sb.array.total_volumes;
if (sb.array.total_volumes == 0)
/* Not RAID. */
return NULL;
break; break;
case NV_LEVEL_1: case NV_LEVEL_1:
...@@ -139,6 +142,9 @@ grub_dmraid_nv_detect (grub_disk_t disk, ...@@ -139,6 +142,9 @@ grub_dmraid_nv_detect (grub_disk_t disk,
case NV_LEVEL_5: case NV_LEVEL_5:
level = 5; level = 5;
disk_size = sb.capacity / (sb.array.total_volumes - 1); 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; break;
default: default:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment