Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ofw fix a ref counting leak



details:   https://anonhg.NetBSD.org/src/rev/1e0ca04359fc
branches:  trunk
changeset: 751011:1e0ca04359fc
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jan 21 15:56:08 2010 +0000

description:
fix a ref counting leak

diffstat:

 sys/dev/ofw/ofw_subr.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r bb06b62aeffb -r 1e0ca04359fc sys/dev/ofw/ofw_subr.c
--- a/sys/dev/ofw/ofw_subr.c    Thu Jan 21 12:55:04 2010 +0000
+++ b/sys/dev/ofw/ofw_subr.c    Thu Jan 21 15:56:08 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_subr.c,v 1.15 2009/11/11 16:56:52 macallan Exp $   */
+/*     $NetBSD: ofw_subr.c,v 1.16 2010/01/21 15:56:08 martin Exp $     */
 
 /*
  * Copyright 1998
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.15 2009/11/11 16:56:52 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.16 2010/01/21 15:56:08 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -283,13 +283,16 @@
        prop_data_t data;
        int len;
        uint8_t prop[256];
+       boolean_t res;
 
        len = OF_getprop(node, ofname, prop, 256);
        if (len < 1)
                return FALSE;
 
        data = prop_data_create_data(prop, len);
-       return(prop_dictionary_set(dict, propname, data));
+       res = prop_dictionary_set(dict, propname, data);
+       prop_object_release(data);
+       return res;
 }
 
 /*



Home | Main Index | Thread Index | Old Index