Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sysmon Free ped if we can't hand it to the power dae...



details:   https://anonhg.NetBSD.org/src/rev/b06b82822d9d
branches:  trunk
changeset: 337158:b06b82822d9d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Apr 04 15:25:16 2015 +0000

description:
Free ped if we can't hand it to the power daemon.

Found by Brainy, reported by maxv@.

diffstat:

 sys/dev/sysmon/sysmon_power.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r d7f8008b68a4 -r b06b82822d9d sys/dev/sysmon/sysmon_power.c
--- a/sys/dev/sysmon/sysmon_power.c     Sat Apr 04 15:22:02 2015 +0000
+++ b/sys/dev/sysmon/sysmon_power.c     Sat Apr 04 15:25:16 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysmon_power.c,v 1.49 2015/01/06 15:39:54 bouyer Exp $ */
+/*     $NetBSD: sysmon_power.c,v 1.50 2015/04/04 15:25:16 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2007 Juan Romero Pardines.
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.49 2015/01/06 15:39:54 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.50 2015/04/04 15:25:16 riastradh Exp $");
 
 #include "opt_compat_netbsd.h"
 #include <sys/param.h>
@@ -800,6 +800,7 @@
 
                if (sysmon_power_daemon_task(ped, pes, event) == 0)
                        return;
+               kmem_free(ped, sizeof(*ped));
        }
 
        switch (pes->pes_type) {
@@ -954,6 +955,7 @@
 
                if (sysmon_power_daemon_task(ped, smpsw, event) == 0)
                        return;
+               kmem_free(ped, sizeof(*ped));
        }
        
        switch (smpsw->smpsw_type) {



Home | Main Index | Thread Index | Old Index