From 2f830861847d467922c152f18be5d6f7bef805dd Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Sat, 26 Mar 2005 21:34:12 +0000 Subject: [PATCH] deal with malloc failure Noticed by: Coverity Prevent analysis tool --- sys/dev/pccard/pccard_cis.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/pccard/pccard_cis.c b/sys/dev/pccard/pccard_cis.c index fce85e7c3dd..ce5a01feda7 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,