summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrent Cook <bcook@cvs.openbsd.org>2019-05-09 14:50:47 +0000
committerBrent Cook <bcook@cvs.openbsd.org>2019-05-09 14:50:47 +0000
commit78dc823157e0f44ed52b2d83f0a71b579909c01a (patch)
tree9c5864ea4f9384501aff3ba40a57bfaa9ed30b39 /sys/dev/pci
parentdb69159e214c6e980d70e0a7e2d50b0b190ba345 (diff)
add free sizes
ok tedu
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/azalia.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index aac04b29c07..af5980abe46 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.248 2019/05/05 09:09:59 kettenis Exp $ */
+/* $OpenBSD: azalia.c,v 1.249 2019/05/09 14:50:46 bcook Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -2547,37 +2547,43 @@ azalia_codec_delete(codec_t *this)
azalia_mixer_delete(this);
if (this->formats != NULL) {
- free(this->formats, M_DEVBUF, 0);
+ free(this->formats, M_DEVBUF,
+ this->nformats * sizeof(struct audio_format));
this->formats = NULL;
}
this->nformats = 0;
if (this->opins != NULL) {
- free(this->opins, M_DEVBUF, 0);
+ free(this->opins, M_DEVBUF,
+ this->nopins * sizeof(struct io_pin));
this->opins = NULL;
}
this->nopins = 0;
if (this->opins_d != NULL) {
- free(this->opins_d, M_DEVBUF, 0);
+ free(this->opins_d, M_DEVBUF,
+ this->nopins_d * sizeof(struct io_pin));
this->opins_d = NULL;
}
this->nopins_d = 0;
if (this->ipins != NULL) {
- free(this->ipins, M_DEVBUF, 0);
+ free(this->ipins, M_DEVBUF,
+ this->nipins * sizeof(struct io_pin));
this->ipins = NULL;
}
this->nipins = 0;
if (this->ipins_d != NULL) {
- free(this->ipins_d, M_DEVBUF, 0);
+ free(this->ipins_d, M_DEVBUF,
+ this->nipins_d * sizeof(struct io_pin));
this->ipins_d = NULL;
}
this->nipins_d = 0;
if (this->w != NULL) {
- free(this->w, M_DEVBUF, 0);
+ free(this->w, M_DEVBUF,
+ this->wend * sizeof(widget_t));
this->w = NULL;
}