From 1531f6d32ec95d99041c65088ab7c238847c9c74 Mon Sep 17 00:00:00 2001 From: freza Date: Fri, 30 May 2008 15:30:37 +0000 Subject: [PATCH] Any time we remove event from the queue make sure we 1. release the event plist and 2. free the drvctl_event struct. Discussed with jmcneill@. --- sys/kern/kern_drvctl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_drvctl.c b/sys/kern/kern_drvctl.c index 61f1bb4ec1c7..9d6181c5d426 100644 --- a/sys/kern/kern_drvctl.c +++ b/sys/kern/kern_drvctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_drvctl.c,v 1.17 2008/05/25 12:30:40 jmcneill Exp $ */ +/* $NetBSD: kern_drvctl.c,v 1.18 2008/05/30 15:30:37 freza Exp $ */ /* * Copyright (c) 2004 @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_drvctl.c,v 1.17 2008/05/25 12:30:40 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_drvctl.c,v 1.18 2008/05/30 15:30:37 freza Exp $"); #include #include @@ -128,6 +128,8 @@ devmon_insert(const char *event, prop_dictionary_t ev) if (drvctl_eventcnt == DRVCTL_EVENTQ_DEPTH) { odce = TAILQ_FIRST(&drvctl_eventq); TAILQ_REMOVE(&drvctl_eventq, odce, dce_link); + prop_object_release(odce->dce_event); + kmem_free(odce, sizeof(*odce)); --drvctl_eventcnt; } @@ -372,6 +374,7 @@ drvctl_close(struct file *fp) TAILQ_REMOVE(&drvctl_eventq, dce, dce_link); KASSERT(drvctl_eventcnt > 0); --drvctl_eventcnt; + prop_object_release(dce->dce_event); kmem_free(dce, sizeof(*dce)); } }