Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/thorpej-i2c-spi-conf2]: src/sys/arch/macppc/dev Fix a memory leak if the...
details: https://anonhg.NetBSD.org/src/rev/77ff62afbdd0
branches: thorpej-i2c-spi-conf2
changeset: 985860:77ff62afbdd0
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sat Sep 11 14:47:06 2021 +0000
description:
Fix a memory leak if the "compatible" property is > 32 bytes.
diffstat:
sys/arch/macppc/dev/ki2c.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diffs (28 lines):
diff -r f1ce0fc2e58f -r 77ff62afbdd0 sys/arch/macppc/dev/ki2c.c
--- a/sys/arch/macppc/dev/ki2c.c Sat Sep 11 13:13:59 2021 +0000
+++ b/sys/arch/macppc/dev/ki2c.c Sat Sep 11 14:47:06 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ki2c.c,v 1.32.2.2 2021/09/10 15:45:28 thorpej Exp $ */
+/* $NetBSD: ki2c.c,v 1.32.2.3 2021/09/11 14:47:06 thorpej Exp $ */
/* Id: ki2c.c,v 1.7 2002/10/05 09:56:05 tsubai Exp */
/*-
@@ -132,14 +132,13 @@
cbrv = args->callback(dev, args);
prop_object_release(props);
-
+ out:
+ kmem_tmpbuf_free(compat, compat_size, compat_buf);
return cbrv; /* callback decides if we keep enumerating */
bad:
- if (compat != compat_buf) {
- kmem_tmpbuf_free(compat, compat_size, compat_buf);
- }
- return true; /* keep enumerating */
+ cbrv = true; /* keep enumerating */
+ goto out;
}
static int
Home |
Main Index |
Thread Index |
Old Index