mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 16:54:02 +00:00
Add missing NULL check after malloc(M_NOWAIT).
Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
This commit is contained in:
parent
ffacde9be5
commit
f5866522ce
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253644
|
@ -287,6 +287,10 @@ ata_promise_chipinit(device_t dev)
|
|||
/* setup host packet controls */
|
||||
hpkt = malloc(sizeof(struct ata_promise_sx4),
|
||||
M_ATAPCI, M_NOWAIT | M_ZERO);
|
||||
if (hpkt == NULL) {
|
||||
device_printf(dev, "Cannot allocate HPKT\n");
|
||||
goto failnfree;
|
||||
}
|
||||
mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF);
|
||||
TAILQ_INIT(&hpkt->queue);
|
||||
hpkt->busy = 0;
|
||||
|
|
Loading…
Reference in a new issue