mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-18 22:33:39 +00:00
deal with malloc failure
Noticed by: Coverity Prevent analysis tool
This commit is contained in:
parent
4204b6b9a0
commit
2f83086184
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144159
|
@ -916,7 +916,10 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
|
||||||
if (num != state->default_cfe->number) {
|
if (num != state->default_cfe->number) {
|
||||||
cfe = (struct pccard_config_entry *)
|
cfe = (struct pccard_config_entry *)
|
||||||
malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT);
|
malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT);
|
||||||
|
if (cfe == NULL) {
|
||||||
|
DPRINTF(("no memory for config entry\n"));
|
||||||
|
goto abort_cfe;
|
||||||
|
}
|
||||||
*cfe = *state->default_cfe;
|
*cfe = *state->default_cfe;
|
||||||
|
|
||||||
STAILQ_INSERT_TAIL(&state->pf->cfe_head,
|
STAILQ_INSERT_TAIL(&state->pf->cfe_head,
|
||||||
|
|
Loading…
Reference in a new issue