summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccard
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-03-26 21:34:12 +0000
committersam <sam@FreeBSD.org>2005-03-26 21:34:12 +0000
commit04d8226ff0345c0cb452b0924e24d48e4934712f (patch)
tree25764567b214a7403c68d03d043b54611c338166 /sys/dev/pccard
parent0c114759156894187abc1f54281816b8c286d792 (diff)
downloadFreeBSD-src-04d8226ff0345c0cb452b0924e24d48e4934712f.zip
FreeBSD-src-04d8226ff0345c0cb452b0924e24d48e4934712f.tar.gz
deal with malloc failure
Noticed by: Coverity Prevent analysis tool
Diffstat (limited to 'sys/dev/pccard')
-rw-r--r--sys/dev/pccard/pccard_cis.c5
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,
OpenPOWER on IntegriCloud