Module Name: src
Committed By: maxv
Date: Sat Oct 15 08:30:42 UTC 2016
Modified Files:
src/sys/dev/fdt: fdt_gpio.c
Log Message:
Memory leak, found by mootja; not tested, but obvious enough
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/fdt_gpio.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/fdt/fdt_gpio.c
diff -u src/sys/dev/fdt/fdt_gpio.c:1.3 src/sys/dev/fdt/fdt_gpio.c:1.4
--- src/sys/dev/fdt/fdt_gpio.c:1.3 Tue Dec 22 22:19:07 2015
+++ src/sys/dev/fdt/fdt_gpio.c Sat Oct 15 08:30:42 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_gpio.c,v 1.3 2015/12/22 22:19:07 jmcneill Exp $ */
+/* $NetBSD: fdt_gpio.c,v 1.4 2016/10/15 08:30:42 maxv Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_gpio.c,v 1.3 2015/12/22 22:19:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_gpio.c,v 1.4 2016/10/15 08:30:42 maxv Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -111,6 +111,7 @@ fdtbus_gpio_acquire(int phandle, const c
gp->gp_priv = gc->gc_funcs->acquire(gc->gc_dev, data, len, flags);
if (gp->gp_priv == NULL) {
kmem_free(data, len);
+ kmem_free(gp, sizeof(*gp));
return NULL;
}