From 9679d7525c205de90e9dcadcf6762b04114f8c45 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 12 Dec 2011 22:24:25 +0100 Subject: kernel: fix more malloc bugs --- sys/src/9/pc/ether79c970.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/src/9/pc/ether79c970.c') diff --git a/sys/src/9/pc/ether79c970.c b/sys/src/9/pc/ether79c970.c index ac1545364..d539cb1d4 100644 --- a/sys/src/9/pc/ether79c970.c +++ b/sys/src/9/pc/ether79c970.c @@ -470,6 +470,11 @@ amd79c970pci(void) continue; } ctlr = malloc(sizeof(Ctlr)); + if(ctlr == nil){ + print("amd79c970: can't allocate memory\n"); + iofree(port); + continue; + } ctlr->port = p->mem[0].bar & ~0x01; ctlr->pcidev = p; -- cgit v1.2.3