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/ethersmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/src/9/pc/ethersmc.c') diff --git a/sys/src/9/pc/ethersmc.c b/sys/src/9/pc/ethersmc.c index 1c2ac8025..64dcd0075 100644 --- a/sys/src/9/pc/ethersmc.c +++ b/sys/src/9/pc/ethersmc.c @@ -708,13 +708,14 @@ reset(Ether* ether) return -1; } - ether->ctlr = malloc(sizeof(Smc91xx)); - ctlr = ether->ctlr; + ctlr = malloc(sizeof(Smc91xx)); if (ctlr == 0) { + print("smc: can't allocate memory\n"); iofree(ether->port); pcmspecialclose(slot); return -1; } + ether->ctlr = ctlr; ilock(ctlr); ctlr->rev = 0; -- cgit v1.2.3