diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-12-12 22:24:25 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-12-12 22:24:25 +0100 |
commit | 9679d7525c205de90e9dcadcf6762b04114f8c45 (patch) | |
tree | 8681e308104e48eed2753c1b76eba1a8bac57341 /sys/src/9/pc/pci.c | |
parent | f32ef135d4bce251f72275d30cfcd86cb188b8c9 (diff) |
kernel: fix more malloc bugs
Diffstat (limited to 'sys/src/9/pc/pci.c')
-rw-r--r-- | sys/src/9/pc/pci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/src/9/pc/pci.c b/sys/src/9/pc/pci.c index 9d28bc1de..decad75ba 100644 --- a/sys/src/9/pc/pci.c +++ b/sys/src/9/pc/pci.c @@ -200,6 +200,8 @@ pcibusmap(Pcidev *root, ulong *pmema, ulong *pioa, int wrreg) ntb *= (PciCIS-PciBAR0)/4; table = malloc(2*ntb*sizeof(Pcisiz)); + if(table == nil) + panic("pcibusmap: can't allocate memory"); itb = table; mtb = table+ntb; @@ -389,6 +391,8 @@ pcilscan(int bno, Pcidev** list) if(l == 0xFFFFFFFF || l == 0) continue; p = malloc(sizeof(*p)); + if(p == nil) + panic("pcilscan: can't allocate memory"); p->tbdf = tbdf; p->vid = l; p->did = l>>16; |