summaryrefslogtreecommitdiff
path: root/sys/src/9/port/segment.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@centraldogma>2011-12-12 19:17:58 +0100
committercinap_lenrek <cinap_lenrek@centraldogma>2011-12-12 19:17:58 +0100
commit8cb8043d0ebeadb0d424fb1051a49573430322a3 (patch)
tree3bb91278b127dce9ebf0d30975bc7197ac2765a8 /sys/src/9/port/segment.c
parent304ee3b2b55971d9f5f820511fb9cdadcb77b818 (diff)
kernel: fix more malloc/smalloc errors
Diffstat (limited to 'sys/src/9/port/segment.c')
-rw-r--r--sys/src/9/port/segment.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/src/9/port/segment.c b/sys/src/9/port/segment.c
index 26a62998e..b48d007f1 100644
--- a/sys/src/9/port/segment.c
+++ b/sys/src/9/port/segment.c
@@ -45,13 +45,15 @@ initseg(void)
Image *i, *ie;
imagealloc.free = xalloc(conf.nimage*sizeof(Image));
- if (imagealloc.free == nil)
- panic("initseg: no memory");
+ if(imagealloc.free == nil)
+ panic("initseg: no memory for Image");
ie = &imagealloc.free[conf.nimage-1];
for(i = imagealloc.free; i < ie; i++)
i->next = i+1;
i->next = 0;
imagealloc.freechan = malloc(NFREECHAN * sizeof(Chan*));
+ if(imagealloc.freechan == nil)
+ panic("initseg: no memory for Chan");
imagealloc.szfreechan = NFREECHAN;
}