From nobody Fri Jan 9 23:27:57 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dnycZ3xyYz6Mp47 for ; Fri, 09 Jan 2026 23:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dnycY6v8Xz3nMp for ; Fri, 09 Jan 2026 23:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768001278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zOx/6ZSuYxAsD6gg43/4dbsQwRI/kVVrikYE+VY1zg8=; b=Yl8SWFPpyybRFg94wuwn6KZkEH7SeEPdjr2/g87uNXB3UhMRriukq72gGpo4dRINk0al3s WvoGc4fSEmJlIFFR9FEGzg6Mn0TC3ioy50kIWPUidmYBAjOfDlDwHn2nJ08Fn9rNE+GIG9 AZ6bFZLEzt6mKx9fDlLTpppL1r+2ZMemWQnh1rc+W4YTnPu05+prNB0RxUGAxSemHjKuAN TgxZIiDthTDfH8+XhoxtmZGErv5cG/y3YcGeNzcUVDiJ4lyWUzTn5WK7IAJyO8su0Aa2cz uLbcRTKu9f2wbInGIov4+dy1c8VLe1BLn2hcPsKGpd8IiqAV5ETXIN5V2Q90iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768001278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zOx/6ZSuYxAsD6gg43/4dbsQwRI/kVVrikYE+VY1zg8=; b=cm9o1zztuaELQs5EP7PrqyKAMUVeVWVw+2ADZmkOLliXHNS2GZ8p2WkjPnRQzHEC51xvYd 1qm2ooa3mv612juSeYFVHyvjeypS6Vg6/j+c4/WMTxBqeymlNQnZi9LxpzEH7sl314NMHM ODaVfF57Of/YuZCFqTo52viIcBSBwegIy6zpMI9vewSyY7a6LvN+K9lgCErkK6Y9briVWN O+LuYT4C3n6XJ2qDkle3ITNpD0kxKJkQbNoojUhcYvssfkqGkO0QalbCJF3YvUmUGkqkIx dJw3qjvOHVOhWhlFL9voOY1/o9m0suGCxNkItdvV3D8Pt4Qbxq5qLjSGgQCiIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768001278; a=rsa-sha256; cv=none; b=F11V9WPmDTo4wwCwIqt5QFyjiKTOx+If7TRzw+AhfbBylw60P+Up5c7aQf1eWk61PTBnQg HH7kRiwb79pIpt5U/aPHMkTKSpwLChxtUsXoYZhWpo5LVCEmZY+xFRVjo08oEwFJMtMOYD /nqC5hGFnnfplrcgW+HCaNL+1IyerPB7TNkqtpGywkQhazoVT97HNnLTJ2toRndJx10drz TbPXtn0Xf5mdbD1xKrK0vvLUu4piQszDV9wbyPS7BLSpwW6DqYLMF4C4VmLrHx0f/+J4kx VO2D+VnRDRgFTe2OWYkL/r94N6DaJw5bs7wDai3ijow6StVi1z1mYMvUxC8QXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dnycY6QBfzTZT for ; Fri, 09 Jan 2026 23:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30df5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 09 Jan 2026 23:27:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 4fc99fc60def - stable/15 - sound: Do not check for NULL before free() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4fc99fc60deff5d438748464a17986060be5dda9 Auto-Submitted: auto-generated Date: Fri, 09 Jan 2026 23:27:57 +0000 Message-Id: <69618efd.30df5.23e41f5d@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4fc99fc60deff5d438748464a17986060be5dda9 commit 4fc99fc60deff5d438748464a17986060be5dda9 Author: Christos Margiolis AuthorDate: 2026-01-02 16:56:52 +0000 Commit: Christos Margiolis CommitDate: 2026-01-09 23:27:24 +0000 sound: Do not check for NULL before free() No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54174 (cherry picked from commit 792251295cdf6c3e1cbb1aa6291434539632912f) --- sys/dev/sound/dummy.c | 3 +-- sys/dev/sound/fdt/audio_soc.c | 6 ++---- sys/dev/sound/midi/midi.c | 6 ++---- sys/dev/sound/pci/cmi.c | 3 +-- sys/dev/sound/pci/envy24.c | 6 ++---- sys/dev/sound/pci/envy24ht.c | 6 ++---- sys/dev/sound/pci/es137x.c | 3 +-- sys/dev/sound/pci/hdsp-pcm.c | 12 ++++-------- sys/dev/sound/pci/hdspe-pcm.c | 12 ++++-------- sys/dev/sound/pci/via8233.c | 3 +-- sys/dev/sound/pci/via82c686.c | 2 +- sys/dev/sound/pcm/buffer.c | 19 ++++++------------- sys/dev/sound/pcm/dsp.c | 3 +-- sys/dev/sound/pcm/feeder_eq.c | 3 +-- sys/dev/sound/pcm/feeder_format.c | 3 +-- sys/dev/sound/pcm/feeder_matrix.c | 3 +-- sys/dev/sound/pcm/feeder_mixer.c | 3 +-- sys/dev/sound/pcm/feeder_rate.c | 37 ++++++++++++------------------------- sys/dev/sound/pcm/feeder_volume.c | 3 +-- sys/dev/sound/usb/uaudio.c | 6 ++---- 20 files changed, 47 insertions(+), 95 deletions(-) diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c index aec76339ae17..91a198e3d9f6 100644 --- a/sys/dev/sound/dummy.c +++ b/sys/dev/sound/dummy.c @@ -132,8 +132,7 @@ dummy_chan_free(kobj_t obj, void *data) uint8_t *buf; buf = ch->buf->buf; - if (buf != NULL) - free(buf, M_DEVBUF); + free(buf, M_DEVBUF); return (0); } diff --git a/sys/dev/sound/fdt/audio_soc.c b/sys/dev/sound/fdt/audio_soc.c index 84867cb3d781..33269dc302fa 100644 --- a/sys/dev/sound/fdt/audio_soc.c +++ b/sys/dev/sound/fdt/audio_soc.c @@ -250,8 +250,7 @@ audio_soc_chan_free(kobj_t obj, void *data) ausoc_chan = (struct audio_soc_channel *)data; buffer = ausoc_chan->buf->buf; - if (buffer) - free(buffer, M_DEVBUF); + free(buffer, M_DEVBUF); return (0); } @@ -508,8 +507,7 @@ audio_soc_detach(device_t dev) struct audio_soc_aux_node *aux; sc = device_get_softc(dev); - if (sc->name) - free(sc->name, M_DEVBUF); + free(sc->name, M_DEVBUF); while ((aux = SLIST_FIRST(&sc->aux_devs)) != NULL) { SLIST_REMOVE_HEAD(&sc->aux_devs, link); diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index 7f968b6210f5..542282d81842 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -153,10 +153,8 @@ midi_init(kobj_class_t cls, void *cookie) err2: mtx_destroy(&m->lock); - if (MIDIQ_BUF(m->inq)) - free(MIDIQ_BUF(m->inq), M_MIDI); - if (MIDIQ_BUF(m->outq)) - free(MIDIQ_BUF(m->outq), M_MIDI); + free(MIDIQ_BUF(m->inq), M_MIDI); + free(MIDIQ_BUF(m->outq), M_MIDI); err1: free(m, M_MIDI); return NULL; diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c index 99925d236c08..b5465fed5a8b 100644 --- a/sys/dev/sound/pci/cmi.c +++ b/sys/dev/sound/pci/cmi.c @@ -1009,8 +1009,7 @@ cmi_attach(device_t dev) if (sc->reg) bus_release_resource(dev, SYS_RES_IOPORT, sc->regid, sc->reg); mtx_destroy(&sc->lock); - if (sc) - free(sc, M_DEVBUF); + free(sc, M_DEVBUF); return ENXIO; } diff --git a/sys/dev/sound/pci/envy24.c b/sys/dev/sound/pci/envy24.c index 3adb22254b72..50864a9067fd 100644 --- a/sys/dev/sound/pci/envy24.c +++ b/sys/dev/sound/pci/envy24.c @@ -1611,10 +1611,8 @@ envy24chan_free(kobj_t obj, void *data) device_printf(sc->dev, "envy24chan_free()\n"); #endif mtx_lock(&sc->lock); - if (ch->data != NULL) { - free(ch->data, M_ENVY24); - ch->data = NULL; - } + free(ch->data, M_ENVY24); + ch->data = NULL; mtx_unlock(&sc->lock); return 0; diff --git a/sys/dev/sound/pci/envy24ht.c b/sys/dev/sound/pci/envy24ht.c index 2396a340cd84..3aca8f92f708 100644 --- a/sys/dev/sound/pci/envy24ht.c +++ b/sys/dev/sound/pci/envy24ht.c @@ -1522,10 +1522,8 @@ envy24htchan_free(kobj_t obj, void *data) device_printf(sc->dev, "envy24htchan_free()\n"); #endif mtx_lock(&sc->lock); - if (ch->data != NULL) { - free(ch->data, M_ENVY24HT); - ch->data = NULL; - } + free(ch->data, M_ENVY24HT); + ch->data = NULL; mtx_unlock(&sc->lock); return 0; diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index 4e8c7911e95e..45b953efc3fc 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -1886,8 +1886,7 @@ bad: if (es->reg) bus_release_resource(dev, es->regtype, es->regid, es->reg); mtx_destroy(&es->lock); - if (es) - free(es, M_DEVBUF); + free(es, M_DEVBUF); return (ENXIO); } diff --git a/sys/dev/sound/pci/hdsp-pcm.c b/sys/dev/sound/pci/hdsp-pcm.c index b64cec281388..5a8f2ab57d6c 100644 --- a/sys/dev/sound/pci/hdsp-pcm.c +++ b/sys/dev/sound/pci/hdsp-pcm.c @@ -677,14 +677,10 @@ hdspchan_free(kobj_t obj, void *data) #endif mtx_lock(&sc->lock); - if (ch->data != NULL) { - free(ch->data, M_HDSP); - ch->data = NULL; - } - if (ch->caps != NULL) { - free(ch->caps, M_HDSP); - ch->caps = NULL; - } + free(ch->data, M_HDSP); + ch->data = NULL; + free(ch->caps, M_HDSP); + ch->caps = NULL; mtx_unlock(&sc->lock); return (0); diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index d78820732639..678693960e5e 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -668,14 +668,10 @@ hdspechan_free(kobj_t obj, void *data) #endif mtx_lock(&sc->lock); - if (ch->data != NULL) { - free(ch->data, M_HDSPE); - ch->data = NULL; - } - if (ch->caps != NULL) { - free(ch->caps, M_HDSPE); - ch->caps = NULL; - } + free(ch->data, M_HDSPE); + ch->data = NULL; + free(ch->caps, M_HDSPE); + ch->caps = NULL; mtx_unlock(&sc->lock); return (0); diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c index 6c59397756e0..90e966b864e3 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -1385,8 +1385,7 @@ bad: if (via->sgd_dmat) bus_dma_tag_destroy(via->sgd_dmat); mtx_destroy(&via->lock); - if (via) - free(via, M_DEVBUF); + free(via, M_DEVBUF); return (ENXIO); } diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c index fe34583b1a25..144f0ff21fb6 100644 --- a/sys/dev/sound/pci/via82c686.c +++ b/sys/dev/sound/pci/via82c686.c @@ -601,7 +601,7 @@ bad: if (via->sgd_table) bus_dmamem_free(via->sgd_dmat, via->sgd_table, via->sgd_dmamap); if (via->sgd_dmat) bus_dma_tag_destroy(via->sgd_dmat); mtx_destroy(&via->lock); - if (via) free(via, M_DEVBUF); + free(via, M_DEVBUF); return ENXIO; } diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index eb2cbe667bf3..1db9e5661dc8 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -129,11 +129,8 @@ sndbuf_setup(struct snd_dbuf *b, void *buf, unsigned int size) void sndbuf_free(struct snd_dbuf *b) { - if (b->tmpbuf) - free(b->tmpbuf, M_DEVBUF); - - if (b->shadbuf) - free(b->shadbuf, M_DEVBUF); + free(b->tmpbuf, M_DEVBUF); + free(b->shadbuf, M_DEVBUF); if (b->buf) { if (b->flags & SNDBUF_F_MANAGED) { @@ -188,8 +185,7 @@ sndbuf_resize(struct snd_dbuf *b, unsigned int blkcnt, unsigned int blksz) printf("%s(): b=%p %p -> %p [%d -> %d : %d]\n", __func__, b, b->tmpbuf, tmpbuf, b->allocsize, allocsize, bufsize); - if (b->tmpbuf != NULL) - free(b->tmpbuf, M_DEVBUF); + free(b->tmpbuf, M_DEVBUF); b->tmpbuf = tmpbuf; b->allocsize = allocsize; } else if (snd_verbose > 3) @@ -225,14 +221,11 @@ sndbuf_remalloc(struct snd_dbuf *b, unsigned int blkcnt, unsigned int blksz) tmpbuf = malloc(allocsize, M_DEVBUF, M_WAITOK); shadbuf = malloc(allocsize, M_DEVBUF, M_WAITOK); CHN_LOCK(b->channel); - if (b->buf != NULL) - free(b->buf, M_DEVBUF); + free(b->buf, M_DEVBUF); b->buf = buf; - if (b->tmpbuf != NULL) - free(b->tmpbuf, M_DEVBUF); + free(b->tmpbuf, M_DEVBUF); b->tmpbuf = tmpbuf; - if (b->shadbuf != NULL) - free(b->shadbuf, M_DEVBUF); + free(b->shadbuf, M_DEVBUF); b->shadbuf = shadbuf; if (snd_verbose > 3) printf("%s(): b=%p %d -> %d [%d]\n", diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 62db4592f206..c1e836691ac7 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2582,8 +2582,7 @@ dsp_oss_syncgroup(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_syncgr out: if (ret != 0) { - if (smrd != NULL) - free(smrd, M_DEVBUF); + free(smrd, M_DEVBUF); if ((sg != NULL) && SLIST_EMPTY(&sg->members)) { sg_ids[2] = sg->id; SLIST_REMOVE(&snd_pcm_syncgroups, sg, pcmchan_syncgroup, link); diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c index 08e789f6a5ad..4cf9d4f6695f 100644 --- a/sys/dev/sound/pcm/feeder_eq.c +++ b/sys/dev/sound/pcm/feeder_eq.c @@ -353,8 +353,7 @@ feed_eq_free(struct pcm_feeder *f) struct feed_eq_info *info; info = f->data; - if (info != NULL) - free(info, M_DEVBUF); + free(info, M_DEVBUF); f->data = NULL; diff --git a/sys/dev/sound/pcm/feeder_format.c b/sys/dev/sound/pcm/feeder_format.c index 3226aebf9580..0747b54cbbae 100644 --- a/sys/dev/sound/pcm/feeder_format.c +++ b/sys/dev/sound/pcm/feeder_format.c @@ -90,8 +90,7 @@ feed_format_free(struct pcm_feeder *f) struct feed_format_info *info; info = f->data; - if (info != NULL) - free(info, M_DEVBUF); + free(info, M_DEVBUF); f->data = NULL; diff --git a/sys/dev/sound/pcm/feeder_matrix.c b/sys/dev/sound/pcm/feeder_matrix.c index 198fe86d994f..cba537c84efd 100644 --- a/sys/dev/sound/pcm/feeder_matrix.c +++ b/sys/dev/sound/pcm/feeder_matrix.c @@ -317,8 +317,7 @@ feed_matrix_free(struct pcm_feeder *f) struct feed_matrix_info *info; info = f->data; - if (info != NULL) - free(info, M_DEVBUF); + free(info, M_DEVBUF); f->data = NULL; diff --git a/sys/dev/sound/pcm/feeder_mixer.c b/sys/dev/sound/pcm/feeder_mixer.c index 74ab633bf3c7..8c58e1c8ef33 100644 --- a/sys/dev/sound/pcm/feeder_mixer.c +++ b/sys/dev/sound/pcm/feeder_mixer.c @@ -100,8 +100,7 @@ feed_mixer_free(struct pcm_feeder *f) struct feed_mixer_info *info; info = f->data; - if (info != NULL) - free(info, M_DEVBUF); + free(info, M_DEVBUF); f->data = NULL; diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c index 63d7fe11003a..aee164840c4a 100644 --- a/sys/dev/sound/pcm/feeder_rate.c +++ b/sys/dev/sound/pcm/feeder_rate.c @@ -714,10 +714,8 @@ z_resampler_reset(struct z_info *info) info->z_size = 1; info->z_coeff = NULL; info->z_dcoeff = NULL; - if (info->z_pcoeff != NULL) { - free(info->z_pcoeff, M_DEVBUF); - info->z_pcoeff = NULL; - } + free(info->z_pcoeff, M_DEVBUF); + info->z_pcoeff = NULL; info->z_scale = Z_ONE; info->z_dx = Z_FULL_ONE; info->z_dy = Z_FULL_ONE; @@ -1029,10 +1027,8 @@ z_resampler_build_polyphase(struct z_info *info) int32_t alpha, c, i, z, idx; /* Let this be here first. */ - if (info->z_pcoeff != NULL) { - free(info->z_pcoeff, M_DEVBUF); - info->z_pcoeff = NULL; - } + free(info->z_pcoeff, M_DEVBUF); + info->z_pcoeff = NULL; if (feeder_rate_polyphase_max < 1) return (ENOTSUP); @@ -1154,10 +1150,8 @@ z_resampler_setup(struct pcm_feeder *f) * adaptive mode. */ z_setup_adaptive_sinc: - if (info->z_pcoeff != NULL) { - free(info->z_pcoeff, M_DEVBUF); - info->z_pcoeff = NULL; - } + free(info->z_pcoeff, M_DEVBUF); + info->z_pcoeff = NULL; if (adaptive == 0) { info->z_dy = z_scale << Z_DRIFT_SHIFT; @@ -1333,8 +1327,7 @@ z_setup_adaptive_sinc: if (info->z_delay == NULL || info->z_alloc < i || i <= (info->z_alloc >> 1)) { - if (info->z_delay != NULL) - free(info->z_delay, M_DEVBUF); + free(info->z_delay, M_DEVBUF); info->z_delay = malloc(i, M_DEVBUF, M_NOWAIT | M_ZERO); if (info->z_delay == NULL) return (ENOMEM); @@ -1517,10 +1510,8 @@ z_resampler_init(struct pcm_feeder *f) ret = z_resampler_setup(f); if (ret != 0) { - if (info->z_pcoeff != NULL) - free(info->z_pcoeff, M_DEVBUF); - if (info->z_delay != NULL) - free(info->z_delay, M_DEVBUF); + free(info->z_pcoeff, M_DEVBUF); + free(info->z_delay, M_DEVBUF); free(info, M_DEVBUF); f->data = NULL; } @@ -1534,13 +1525,9 @@ z_resampler_free(struct pcm_feeder *f) struct z_info *info; info = f->data; - if (info != NULL) { - if (info->z_pcoeff != NULL) - free(info->z_pcoeff, M_DEVBUF); - if (info->z_delay != NULL) - free(info->z_delay, M_DEVBUF); - free(info, M_DEVBUF); - } + free(info->z_pcoeff, M_DEVBUF); + free(info->z_delay, M_DEVBUF); + free(info, M_DEVBUF); f->data = NULL; diff --git a/sys/dev/sound/pcm/feeder_volume.c b/sys/dev/sound/pcm/feeder_volume.c index 3e9e3484fba8..fc4ed1bbb0a5 100644 --- a/sys/dev/sound/pcm/feeder_volume.c +++ b/sys/dev/sound/pcm/feeder_volume.c @@ -193,8 +193,7 @@ feed_volume_free(struct pcm_feeder *f) struct feed_volume_info *info; info = f->data; - if (info != NULL) - free(info, M_DEVBUF); + free(info, M_DEVBUF); f->data = NULL; diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 65c1327ee0f2..86fb5228a990 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -2704,10 +2704,8 @@ error: int uaudio_chan_free(struct uaudio_chan *ch) { - if (ch->buf != NULL) { - free(ch->buf, M_DEVBUF); - ch->buf = NULL; - } + free(ch->buf, M_DEVBUF); + ch->buf = NULL; usbd_transfer_unsetup(ch->xfer, UAUDIO_NCHANBUFS + 1); ch->num_alt = 0;