From a416a056fff15d472930cf429a7fa0b99d9f1721 Mon Sep 17 00:00:00 2001 From: Mike Belopuhov Date: Thu, 19 Jan 2017 12:36:51 +0000 Subject: No need for conditionals around free(9) --- sys/dev/pv/xbf.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'sys') diff --git a/sys/dev/pv/xbf.c b/sys/dev/pv/xbf.c index 8b5fad22acc..89864b96047 100644 --- a/sys/dev/pv/xbf.c +++ b/sys/dev/pv/xbf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbf.c,v 1.15 2017/01/18 22:18:47 mikeb Exp $ */ +/* $OpenBSD: xbf.c,v 1.16 2017/01/19 12:36:50 mikeb Exp $ */ /* * Copyright (c) 2016 Mike Belopuhov @@ -1175,21 +1175,18 @@ xbf_ring_destroy(struct xbf_softc *sc) continue; xbf_scsi_done(sc->sc_xs[i], XS_RESET); } - if (sc->sc_xs) { - free(sc->sc_xs, M_DEVBUF, sc->sc_xr_ndesc * - sizeof(struct scsi_xfer *)); - sc->sc_xs = NULL; - } - if (sc->sc_xs_map) { - free(sc->sc_xs_map, M_DEVBUF, sc->sc_xr_ndesc * - sizeof(bus_dmamap_t)); - sc->sc_xs_map = NULL; - } - if (sc->sc_xs_bb) { - free(sc->sc_xs_bb, M_DEVBUF, sc->sc_xr_ndesc * - sizeof(struct xbf_dma_mem)); - sc->sc_xs_bb = NULL; - } + + free(sc->sc_xs, M_DEVBUF, sc->sc_xr_ndesc * + sizeof(struct scsi_xfer *)); + sc->sc_xs = NULL; + + free(sc->sc_xs_map, M_DEVBUF, sc->sc_xr_ndesc * + sizeof(bus_dmamap_t)); + sc->sc_xs_map = NULL; + + free(sc->sc_xs_bb, M_DEVBUF, sc->sc_xr_ndesc * + sizeof(struct xbf_dma_mem)); + sc->sc_xs_bb = NULL; xbf_dma_free(sc, &sc->sc_xr_dma); -- cgit v1.2.3