Free freq_names if k[78]pnow_current_state is NULL, pointed out

by cube.
This commit is contained in:
xtraeme 2006-08-06 18:21:32 +00:00
parent cc94fcb6e9
commit 421fdf2f64
2 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: powernow_k8.c,v 1.1 2006/08/06 15:37:21 xtraeme Exp $ */
/* $NetBSD: powernow_k8.c,v 1.2 2006/08/06 18:21:32 xtraeme Exp $ */
/* $OpenBSD: powernow-k8.c,v 1.8 2006/06/16 05:58:50 gwk Exp $ */
/*-
@ -89,7 +89,7 @@
/* AMD POWERNOW K8 driver */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: powernow_k8.c,v 1.1 2006/08/06 15:37:21 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: powernow_k8.c,v 1.2 2006/08/06 18:21:32 xtraeme Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -420,6 +420,7 @@ k8_powernow_init(void)
if (k8pnow_current_state == NULL) {
free(cstate, M_DEVBUF);
free(freq_names, M_SYSCTLDATA);
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: powernow_k7.c,v 1.10 2006/08/06 16:05:07 xtraeme Exp $ */
/* $NetBSD: powernow_k7.c,v 1.11 2006/08/06 18:21:32 xtraeme Exp $ */
/* $OpenBSD: powernow-k7.c,v 1.24 2006/06/16 05:58:50 gwk Exp $ */
/*-
@ -89,7 +89,7 @@
/* AMD POWERNOW K7 driver */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: powernow_k7.c,v 1.10 2006/08/06 16:05:07 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: powernow_k7.c,v 1.11 2006/08/06 18:21:32 xtraeme Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -382,6 +382,7 @@ k7_powernow_init(void)
}
if (k7pnow_current_state == NULL) {
free(freq_names, M_SYSCTLDATA);
free(cstate, M_DEVBUF);
return;
}
@ -452,5 +453,8 @@ k7_powernow_destroy(void)
{
#ifdef _LKM
sysctl_teardown(SYSCTLLOG);
if (freq_names)
free(freq_names, M_SYSCTLDATA);
#endif
}