From owner-svn-src-all@freebsd.org Tue Aug 9 15:50:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EF07BB2654; Tue, 9 Aug 2016 15:50:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8F021647; Tue, 9 Aug 2016 15:50:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79Fo37W080795; Tue, 9 Aug 2016 15:50:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79Fo3iU080794; Tue, 9 Aug 2016 15:50:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608091550.u79Fo3iU080794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 9 Aug 2016 15:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303872 - head/sys/dev/tws X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2016 15:50:05 -0000 Author: trasz Date: Tue Aug 9 15:50:03 2016 New Revision: 303872 URL: https://svnweb.freebsd.org/changeset/base/303872 Log: Remove NULL checks after M_WAITOK allocations from tws(4). MFC after: 1 month Modified: head/sys/dev/tws/tws.c Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Tue Aug 9 11:37:08 2016 (r303871) +++ head/sys/dev/tws/tws.c Tue Aug 9 15:50:03 2016 (r303872) @@ -606,21 +606,9 @@ tws_init(struct tws_softc *sc) sc->reqs = malloc(sizeof(struct tws_request) * tws_queue_depth, M_TWS, M_WAITOK | M_ZERO); - if ( sc->reqs == NULL ) { - TWS_TRACE_DEBUG(sc, "malloc failed", 0, sc->is64bit); - return(ENOMEM); - } sc->sense_bufs = malloc(sizeof(struct tws_sense) * tws_queue_depth, M_TWS, M_WAITOK | M_ZERO); - if ( sc->sense_bufs == NULL ) { - TWS_TRACE_DEBUG(sc, "sense malloc failed", 0, sc->is64bit); - return(ENOMEM); - } sc->scan_ccb = malloc(sizeof(union ccb), M_TWS, M_WAITOK | M_ZERO); - if ( sc->scan_ccb == NULL ) { - TWS_TRACE_DEBUG(sc, "ccb malloc failed", 0, sc->is64bit); - return(ENOMEM); - } if (bus_dmamem_alloc(sc->data_tag, (void **)&sc->ioctl_data_mem, (BUS_DMA_NOWAIT | BUS_DMA_ZERO), &sc->ioctl_data_map)) { device_printf(sc->tws_dev, "Cannot allocate ioctl data mem\n"); @@ -668,8 +656,6 @@ tws_init_aen_q(struct tws_softc *sc) sc->aen_q.overflow=0; sc->aen_q.q = malloc(sizeof(struct tws_event_packet)*sc->aen_q.depth, M_TWS, M_WAITOK | M_ZERO); - if ( ! sc->aen_q.q ) - return(FAILURE); return(SUCCESS); } @@ -682,8 +668,6 @@ tws_init_trace_q(struct tws_softc *sc) sc->trace_q.overflow=0; sc->trace_q.q = malloc(sizeof(struct tws_trace_rec)*sc->trace_q.depth, M_TWS, M_WAITOK | M_ZERO); - if ( ! sc->trace_q.q ) - return(FAILURE); return(SUCCESS); }