+2014-01-29 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/disk/ahci.c: Allocate and clean space for all possible 32
+ slots to avoid pointing to uninited area.
+
2014-01-29 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/ahci.c: Do not enable I/O decoding and keep
grub_dprintf ("ahci", "err: %x\n",
adevs[i]->hba->ports[adevs[i]->port].sata_error);
- adevs[i]->command_list_chunk = grub_memalign_dma32 (1024, sizeof (struct grub_ahci_cmd_head));
+ adevs[i]->command_list_chunk = grub_memalign_dma32 (1024, sizeof (struct grub_ahci_cmd_head) * 32);
if (!adevs[i]->command_list_chunk)
{
adevs[i] = 0;
adevs[i]->command_list = grub_dma_get_virt (adevs[i]->command_list_chunk);
adevs[i]->command_table = grub_dma_get_virt (adevs[i]->command_table_chunk);
+
+ grub_memset ((void *) adevs[i]->command_list, 0,
+ sizeof (struct grub_ahci_cmd_table));
+ grub_memset ((void *) adevs[i]->command_table, 0,
+ sizeof (struct grub_ahci_cmd_head) * 32);
+
adevs[i]->command_list->command_table_base
= grub_dma_get_phys (adevs[i]->command_table_chunk);