diff options
author | sam <sam@FreeBSD.org> | 2005-03-26 21:34:12 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-03-26 21:34:12 +0000 |
commit | 04d8226ff0345c0cb452b0924e24d48e4934712f (patch) | |
tree | 25764567b214a7403c68d03d043b54611c338166 | |
parent | 0c114759156894187abc1f54281816b8c286d792 (diff) | |
download | FreeBSD-src-04d8226ff0345c0cb452b0924e24d48e4934712f.zip FreeBSD-src-04d8226ff0345c0cb452b0924e24d48e4934712f.tar.gz |
deal with malloc failure
Noticed by: Coverity Prevent analysis tool
-rw-r--r-- | sys/dev/pccard/pccard_cis.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pccard/pccard_cis.c b/sys/dev/pccard/pccard_cis.c index fce85e7..ce5a01f 100644 --- a/sys/dev/pccard/pccard_cis.c +++ b/sys/dev/pccard/pccard_cis.c @@ -916,7 +916,10 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg) if (num != state->default_cfe->number) { cfe = (struct pccard_config_entry *) malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT); - + if (cfe == NULL) { + DPRINTF(("no memory for config entry\n")); + goto abort_cfe; + } *cfe = *state->default_cfe; STAILQ_INSERT_TAIL(&state->pf->cfe_head, |