Remove NULL checks after M_WAITOK allocations from firewire.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2016-05-10 10:21:03 +00:00
parent aa3ec63e02
commit 256a4cb9d7
5 changed files with 0 additions and 22 deletions

View File

@ -102,8 +102,6 @@ fwdev_allocbuf(struct firewire_comm *fc, struct fw_xferq *q,
q->bulkxfer = malloc(sizeof(struct fw_bulkxfer) * b->nchunk,
M_FW, M_WAITOK);
if (q->bulkxfer == NULL)
return (ENOMEM);
b->psize = roundup2(b->psize, sizeof(uint32_t));
q->buf = fwdma_malloc_multiseg(fc, sizeof(uint32_t),
@ -179,8 +177,6 @@ fw_open(struct cdev *dev, int flags, int fmt, fw_proc *td)
FW_GUNLOCK(sc->fc);
dev->si_drv1 = malloc(sizeof(struct fw_drv1), M_FW, M_WAITOK | M_ZERO);
if (dev->si_drv1 == NULL)
return (ENOMEM);
if ((dev->si_flags & SI_NAMED) == 0) {
int unit = DEV2UNIT(dev);
@ -742,10 +738,6 @@ out:
break;
}
fwb = malloc(sizeof(struct fw_bind), M_FW, M_WAITOK);
if (fwb == NULL) {
err = ENOMEM;
break;
}
fwb->start = ((u_int64_t)bindreq->start.hi << 32) |
bindreq->start.lo;
fwb->end = fwb->start + bindreq->len;

View File

@ -160,10 +160,6 @@ fwdma_malloc_multiseg(struct firewire_comm *fc, int alignment,
}
am = (struct fwdma_alloc_multi *)malloc(sizeof(struct fwdma_alloc_multi)
+ sizeof(struct fwdma_seg)*nseg, M_FW, M_WAITOK);
if (am == NULL) {
printf("fwdma_malloc_multiseg: malloc failed\n");
return (NULL);
}
am->ssize = ssize;
am->esize = esize;
am->nseg = 0;

View File

@ -287,8 +287,6 @@ fwmem_open(struct cdev *dev, int flags, int fmt, fw_proc *td)
FW_GUNLOCK(sc->fc);
dev->si_drv1 = malloc(sizeof(struct fwmem_softc),
M_FWMEM, M_WAITOK);
if (dev->si_drv1 == NULL)
return (ENOMEM);
dev->si_iosize_max = DFLTPHYS;
fms = dev->si_drv1;
bcopy(&fwmem_eui64, &fms->eui, sizeof(struct fw_eui64));

View File

@ -1247,10 +1247,6 @@ fwohci_db_init(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
db_tr = (struct fwohcidb_tr *)
malloc(sizeof(struct fwohcidb_tr) * dbch->ndb,
M_FW, M_WAITOK | M_ZERO);
if (db_tr == NULL) {
printf("fwohci_db_init: malloc(1) failed\n");
return;
}
#define DB_SIZE(x) (sizeof(struct fwohcidb) * (x)->ndesc)
dbch->am = fwdma_malloc_multiseg(&sc->fc, sizeof(struct fwohcidb),

View File

@ -307,10 +307,6 @@ fwe_init(void *arg)
xferq->bulkxfer = (struct fw_bulkxfer *) malloc(
sizeof(struct fw_bulkxfer) * xferq->bnchunk,
M_FWE, M_WAITOK);
if (xferq->bulkxfer == NULL) {
printf("if_fwe: malloc failed\n");
return;
}
STAILQ_INIT(&xferq->stvalid);
STAILQ_INIT(&xferq->stfree);
STAILQ_INIT(&xferq->stdma);