ref: 6301d1235e973154220f1418be65de5ef72e1caa
parent: 7e898a2b78b1371f50531048bd6188e0ceba5f42
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Mon May 20 13:43:30 EDT 2013
uarti8250: print on malloc failure
--- a/sys/src/9/pc/uarti8250.c
+++ b/sys/src/9/pc/uarti8250.c
@@ -621,12 +621,14 @@
{Ctlr *ctlr;
- if((ctlr = malloc(sizeof(Ctlr))) != nil){- ctlr->io = io;
- ctlr->irq = irq;
- ctlr->tbdf = tbdf;
+ ctlr = malloc(sizeof(Ctlr));
+ if(ctlr == nil){+ print("i8250alloc: no memory for Ctlr\n");+ return nil;
}
-
+ ctlr->io = io;
+ ctlr->irq = irq;
+ ctlr->tbdf = tbdf;
return ctlr;
}
--
⑨