diff --git a/sys/dev/disk/iscsi/initiator/isc_soc.c b/sys/dev/disk/iscsi/initiator/isc_soc.c --- a/sys/dev/disk/iscsi/initiator/isc_soc.c +++ b/sys/dev/disk/iscsi/initiator/isc_soc.c @@ -542,6 +542,10 @@ debug(3, "out of pdus, wait"); pq = pdu_alloc(sp->isc, M_NOWAIT); // OK to WAIT } + if(pq == NULL) { + xdebug("pdu_alloc failed in so_input, dropping PDU"); + return ENOBUFS; + } pq->pdu.ipdu.bhs = sp->bhs; pq->len = sizeof(bhs_t); // so far only the header was read error = so_recv(sp, pq);