diff options
author | gibbs <gibbs@FreeBSD.org> | 1998-12-22 18:12:09 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1998-12-22 18:12:09 +0000 |
commit | b4aed04769ad4f1b1f8b3f272920da8c55b2ee0d (patch) | |
tree | 980d94fcd929eb9370aea0f1a6f7eda1013446c7 /sys/dev/advansys/advansys.c | |
parent | 247c297d5ae726b4cd78f8c25d57f1cfe7786474 (diff) | |
download | FreeBSD-src-b4aed04769ad4f1b1f8b3f272920da8c55b2ee0d.zip FreeBSD-src-b4aed04769ad4f1b1f8b3f272920da8c55b2ee0d.tar.gz |
Return NULL on resource shortage instead of blindly continuing.
Obtained from: Eivind Eklund <eivind@yes.no>
Diffstat (limited to 'sys/dev/advansys/advansys.c')
-rw-r--r-- | sys/dev/advansys/advansys.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/advansys/advansys.c b/sys/dev/advansys/advansys.c index de58917..f0588f8 100644 --- a/sys/dev/advansys/advansys.c +++ b/sys/dev/advansys/advansys.c @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: advansys.c,v 1.5 1998/10/29 17:41:34 gibbs Exp $ + * $Id: advansys.c,v 1.6 1998/12/04 22:54:44 archie Exp $ */ /* * Ported from: @@ -554,8 +554,10 @@ adv_alloc_ccb_info(struct adv_softc *adv) struct adv_ccb_info *cinfo; cinfo = malloc(sizeof(*cinfo), M_DEVBUF, M_NOWAIT); - if (cinfo == NULL) + if (cinfo == NULL) { printf("%s: Can't malloc CCB info\n", adv_name(adv)); + return (NULL); + } cinfo->state = ACCB_FREE; error = bus_dmamap_create(adv->buffer_dmat, /*flags*/0, &cinfo->dmamap); |