Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Fix memory leak. Found by kLSan.



details:   https://anonhg.NetBSD.org/src/rev/df1ae4c0b8ef
branches:  trunk
changeset: 973162:df1ae4c0b8ef
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Jun 22 16:14:18 2020 +0000

description:
Fix memory leak. Found by kLSan.

diffstat:

 sys/dev/acpi/acpi.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 124774138a5b -r df1ae4c0b8ef sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Mon Jun 22 16:05:20 2020 +0000
+++ b/sys/dev/acpi/acpi.c       Mon Jun 22 16:14:18 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.284 2020/04/09 10:46:19 jmcneill Exp $      */
+/*     $NetBSD: acpi.c,v 1.285 2020/06/22 16:14:18 maxv Exp $  */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.284 2020/04/09 10:46:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.285 2020/06/22 16:14:18 maxv Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -792,6 +792,11 @@
                }
 
                awc->aw_parent = ad;
+               break;
+
+       default:
+               ACPI_FREE(devinfo);
+               break;
        }
 
        return AE_OK;



Home | Main Index | Thread Index | Old Index