diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-12-12 19:17:58 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-12-12 19:17:58 +0100 |
commit | 8cb8043d0ebeadb0d424fb1051a49573430322a3 (patch) | |
tree | 3bb91278b127dce9ebf0d30975bc7197ac2765a8 /sys/src/9/port/devpnp.c | |
parent | 304ee3b2b55971d9f5f820511fb9cdadcb77b818 (diff) |
kernel: fix more malloc/smalloc errors
Diffstat (limited to 'sys/src/9/port/devpnp.c')
-rw-r--r-- | sys/src/9/port/devpnp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/src/9/port/devpnp.c b/sys/src/9/port/devpnp.c index 805a21303..805c614ad 100644 --- a/sys/src/9/port/devpnp.c +++ b/sys/src/9/port/devpnp.c @@ -193,7 +193,9 @@ findcsn(int csn, int create, int dolock) l = &c->next; } if(create) { - *l = nc = malloc(sizeof(Card)); + if((nc = malloc(sizeof(Card))) == nil) + panic("pnp: no memory for Card"); + *l = nc; nc->next = c; nc->csn = csn; c = nc; |