summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2016-05-15 08:36:12 +0000
committertrasz <trasz@FreeBSD.org>2016-05-15 08:36:12 +0000
commit132d0ef646ccb4ac60b422a52efae035a51deee2 (patch)
tree3487051bda90f7949f38c114b9b38f90f7bd995a
parentd285612c319eac65bf36f715f7a38c5aca58382a (diff)
downloadFreeBSD-src-132d0ef646ccb4ac60b422a52efae035a51deee2.zip
FreeBSD-src-132d0ef646ccb4ac60b422a52efae035a51deee2.tar.gz
Remove NULL checks after M_WAITOK allocations from isp(4).
MFC after: 1 month Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/dev/isp/isp_pci.c11
-rw-r--r--sys/dev/isp/isp_sbus.c11
2 files changed, 0 insertions, 22 deletions
diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c
index 0eefc16..4532155 100644
--- a/sys/dev/isp/isp_pci.c
+++ b/sys/dev/isp/isp_pci.c
@@ -1593,11 +1593,6 @@ isp_pci_mbxdma(ispsoftc_t *isp)
len = isp->isp_maxcmds * sizeof (struct isp_pcmd);
isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
- if (isp->isp_osinfo.pcmd_pool == NULL) {
- isp_prt(isp, ISP_LOGERR, "cannot allocate pcmds");
- ISP_LOCK(isp);
- return (1);
- }
if (isp->isp_osinfo.sixtyfourbit) {
nsegs = ISP_NSEG64_MAX;
@@ -1614,12 +1609,6 @@ isp_pci_mbxdma(ispsoftc_t *isp)
len = sizeof (isp_hdl_t) * isp->isp_maxcmds;
isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
- if (isp->isp_xflist == NULL) {
- free(isp->isp_osinfo.pcmd_pool, M_DEVBUF);
- ISP_LOCK(isp);
- isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array");
- return (1);
- }
for (len = 0; len < isp->isp_maxcmds - 1; len++) {
isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1];
}
diff --git a/sys/dev/isp/isp_sbus.c b/sys/dev/isp/isp_sbus.c
index f1ca83c..b3963b9 100644
--- a/sys/dev/isp/isp_sbus.c
+++ b/sys/dev/isp/isp_sbus.c
@@ -448,19 +448,8 @@ isp_sbus_mbxdma(ispsoftc_t *isp)
len = sizeof (struct isp_pcmd) * isp->isp_maxcmds;
isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *)
malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
- if (isp->isp_osinfo.pcmd_pool == NULL) {
- isp_prt(isp, ISP_LOGERR, "cannot alloc pcmd pool");
- ISP_LOCK(isp);
- return (1);
- }
-
len = sizeof (isp_hdl_t *) * isp->isp_maxcmds;
isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
- if (isp->isp_xflist == NULL) {
- isp_prt(isp, ISP_LOGERR, "cannot alloc xflist array");
- ISP_LOCK(isp);
- return (1);
- }
for (len = 0; len < isp->isp_maxcmds - 1; len++) {
isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1];
}
OpenPOWER on IntegriCloud