Module Name: src
Committed By: martin
Date: Thu Jan 21 15:56:08 UTC 2010
Modified Files:
src/sys/dev/ofw: ofw_subr.c
Log Message:
fix a ref counting leak
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/ofw/ofw_subr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ofw/ofw_subr.c
diff -u src/sys/dev/ofw/ofw_subr.c:1.15 src/sys/dev/ofw/ofw_subr.c:1.16
--- src/sys/dev/ofw/ofw_subr.c:1.15 Wed Nov 11 16:56:52 2009
+++ src/sys/dev/ofw/ofw_subr.c Thu Jan 21 15:56:08 2010
@@ -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;
}
/*