Skip to content

Commit

Permalink
initialize pci structure before add it into the linked list fixes #25,
Browse files Browse the repository at this point in the history
…closes #26
  • Loading branch information
mikaku committed Feb 25, 2023
1 parent d1a53ab commit 4362046
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/pci.c
Expand Up @@ -88,7 +88,6 @@ static void add_pci_device(int bus, int dev, int func, struct pci_device *pci_de
if(!(pdt = (struct pci_device *)kmalloc2(sizeof(struct pci_device)))) {
return;
}
memset_b(pdt, 0, sizeof(struct pci_device));

pci_dev->command = pci_read_short(bus, dev, func, PCI_COMMAND);
pci_dev->status = pci_read_short(bus, dev, func, PCI_STATUS);
Expand Down Expand Up @@ -144,6 +143,7 @@ static void scan_bus(void)
printk(" - %s\n", "Unknown");
} else {
printk(" - %s\n", name);
memset_b(&pci_dev, 0, sizeof(struct pci_device));
pci_dev.bus = b;
pci_dev.dev = d;
pci_dev.func = f;
Expand Down

0 comments on commit 4362046

Please sign in to comment.