Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/dev/ieee1394/sbp.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/dev/ieee1394/sbp.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.36.30.1 retrieving revision 1.36.30.2 diff -u -p -r1.36.30.1 -r1.36.30.2 --- src/sys/dev/ieee1394/sbp.c 2019/06/10 22:07:11 1.36.30.1 +++ src/sys/dev/ieee1394/sbp.c 2020/04/13 08:04:22 1.36.30.2 @@ -1,4 +1,4 @@ -/* $NetBSD: sbp.c,v 1.36.30.1 2019/06/10 22:07:11 christos Exp $ */ +/* $NetBSD: sbp.c,v 1.36.30.2 2020/04/13 08:04:22 martin Exp $ */ /*- * Copyright (c) 2003 Hidetoshi Shimokawa * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sbp.c,v 1.36.30.1 2019/06/10 22:07:11 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sbp.c,v 1.36.30.2 2020/04/13 08:04:22 martin Exp $"); #include @@ -711,13 +711,7 @@ END_DEBUG if (maxlun != target->num_lun) { newluns = (struct sbp_dev **) realloc(target->luns, sizeof(struct sbp_dev *) * maxlun, - M_SBP, M_NOWAIT | M_ZERO); - - if (newluns == NULL) { - aprint_error_dev(sc->sc_fd.dev, "realloc failed\n"); - newluns = target->luns; - maxlun = target->num_lun; - } + M_SBP, M_WAITOK | M_ZERO); /* * We must zero the extended region for the case @@ -751,12 +745,7 @@ END_DEBUG sdev = target->luns[lun]; if (sdev == NULL) { sdev = malloc(sizeof(struct sbp_dev), - M_SBP, M_NOWAIT | M_ZERO); - if (sdev == NULL) { - aprint_error_dev(sc->sc_fd.dev, - "malloc failed\n"); - goto next; - } + M_SBP, M_WAITOK | M_ZERO); target->luns[lun] = sdev; sdev->lun_id = lun; sdev->target = target; @@ -2052,7 +2041,6 @@ sbp_free_sdev(struct sbp_dev *sdev) bus_dmamap_destroy(sc->sc_dmat, sdev->ocb[i].dmamap); fwdma_free(sdev->dma.dma_tag, sdev->dma.dma_map, sdev->dma.v_addr); free(sdev, M_SBP); - sdev = NULL; } static void