Destroy the callout via sysmon_envsys_destroy() now that it's

initialized in sysmon_envsys_create().
This commit is contained in:
xtraeme 2008-02-02 02:02:37 +00:00
parent 16f978c748
commit b5abdb42f6
2 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysmon_envsys.c,v 1.79 2008/01/02 12:20:26 xtraeme Exp $ */
/* $NetBSD: sysmon_envsys.c,v 1.80 2008/02/02 02:02:37 xtraeme Exp $ */
/*-
* Copyright (c) 2007 Juan Romero Pardines.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.79 2008/01/02 12:20:26 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.80 2008/02/02 02:02:37 xtraeme Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -528,8 +528,8 @@ sysmon_envsys_create(void)
/*
* sysmon_envsys_destroy:
*
* + Removes all sensors from the tail queue and frees the
* sysmon_envsys object.
* + Removes all sensors from the tail queue, destroys the callout
* and frees the sysmon_envsys object.
*/
void
sysmon_envsys_destroy(struct sysmon_envsys *sme)
@ -542,7 +542,7 @@ sysmon_envsys_destroy(struct sysmon_envsys *sme)
edata = TAILQ_FIRST(&sme->sme_sensors_list);
TAILQ_REMOVE(&sme->sme_sensors_list, edata, sensors_head);
}
callout_destroy(&sme->sme_callout);
kmem_free(sme, sizeof(*sme));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysmon_envsys_events.c,v 1.47 2008/01/02 12:20:26 xtraeme Exp $ */
/* $NetBSD: sysmon_envsys_events.c,v 1.48 2008/02/02 02:02:38 xtraeme Exp $ */
/*-
* Copyright (c) 2007 Juan Romero Pardines.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.47 2008/01/02 12:20:26 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.48 2008/02/02 02:02:38 xtraeme Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -382,8 +382,9 @@ out:
/*
* sme_events_destroy:
*
* + Destroys the events framework for this device: the workqueue and the
* callout are stopped/destroyed because the queue is empty.
* + Destroys the events framework for this device: the callout
* is stopped and its workqueue is destroyed because the queue
* is empty.
*/
void
sme_events_destroy(struct sysmon_envsys *sme)
@ -394,7 +395,6 @@ sme_events_destroy(struct sysmon_envsys *sme)
sme->sme_flags &= ~SME_CALLOUT_INITIALIZED;
DPRINTF(("%s: events framework destroyed for '%s'\n",
__func__, sme->sme_name));
callout_destroy(&sme->sme_callout);
workqueue_destroy(sme->sme_wq);
}