diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2009-11-11 23:12:40 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2009-11-11 23:12:40 +0000 |
commit | 231e7a5484a8f574e02b352fad12963a95846f03 (patch) | |
tree | 6e282dc14d9b68592635a75114157ed6b5ad6f86 /sys | |
parent | 21e16ba837d0a9686d6b4b4dbb5c3fdfc8e779d9 (diff) |
fix memory leak found by parfait
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/azalia.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index a6512d65f50..815a1069d0b 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.159 2009/10/27 12:30:11 jakemsr Exp $ */ +/* $OpenBSD: azalia.c,v 1.160 2009/11/11 23:12:39 jakemsr Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -1874,6 +1874,7 @@ azalia_codec_select_dacs(codec_t *this) if (convs == NULL) return(ENOMEM); + err = 0; nconv = 0; for (i = 0; i < this->nopins; i++) { isfhp = 0; @@ -1894,7 +1895,7 @@ azalia_codec_select_dacs(codec_t *this) if (isfhp) this->fhp_dac = conv; if (nconv >= this->na_dacs) { - return(0); + break; } } else { /* find a different dac */ @@ -1918,21 +1919,20 @@ azalia_codec_select_dacs(codec_t *this) err = azalia_comresp(this, w->nid, CORB_SET_CONNECTION_SELECT_CONTROL, j, 0); if (err) - return(err); + break; w->selected = j; this->opins[i].conv = conv; if (isfhp) this->fhp_dac = conv; convs[nconv++] = conv; if (nconv >= this->na_dacs) - return(0); + break; } } } free(convs, M_DEVBUF); - - return(0); + return(err); } /* Connect the speaker to a DAC that no other output pin is connected |