summaryrefslogtreecommitdiff
path: root/sys/src/9/port/devaoe.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-05-12 19:04:07 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-05-12 19:04:07 +0200
commit3cccb8fb124b3dffd9124551d74c13b4531dc3f2 (patch)
tree6b8e05b01f9128ea8a20f9427192186f35005212 /sys/src/9/port/devaoe.c
parent8020743579ed7398bf0c61e5723d827d41d70475 (diff)
devaoe: avoid panic on malloc() error by using smalloc() instead.
Diffstat (limited to 'sys/src/9/port/devaoe.c')
-rw-r--r--sys/src/9/port/devaoe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/9/port/devaoe.c b/sys/src/9/port/devaoe.c
index 85ce88494..0512f7016 100644
--- a/sys/src/9/port/devaoe.c
+++ b/sys/src/9/port/devaoe.c
@@ -1362,7 +1362,7 @@ devlinkread(Chan *c, void *db, int len, int off)
return 0;
l = d->dl + i;
- s = p = malloc(READSTR);
+ s = p = smalloc(READSTR);
e = s + READSTR;
p = seprint(p, e, "addr: ");
@@ -1398,7 +1398,7 @@ topctlread(Chan *, void *db, int len, int off)
char *s, *p, *e;
Netlink *n;
- s = p = malloc(READSTR);
+ s = p = smalloc(READSTR);
e = s + READSTR;
p = seprint(p, e, "debug: %d\n", debug);
@@ -1463,7 +1463,7 @@ configwrite(Aoedev *d, void *db, long len)
if(len > sizeof d->config)
error(Etoobig);
srb = srballoc(len);
- s = malloc(len);
+ s = smalloc(len);
memmove(s, db, len);
if(waserror()){
srbfree(srb);
@@ -1679,7 +1679,7 @@ unitwrite(Chan *c, void *db, long n, vlong off)
case Qconfig:
if(off + n > sizeof d->config)
error(Etoobig);
- buf = malloc(sizeof d->config);
+ buf = smalloc(sizeof d->config);
if(waserror()){
free(buf);
nexterror();