Source-Changes-HG archive

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

[src/trunk]: src/sys/dev vnd_destroy: don't access freed memory.



details:   https://anonhg.NetBSD.org/src/rev/f6987c0ef12a
branches:  trunk
changeset: 587950:f6987c0ef12a
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Feb 04 10:48:32 2006 +0000

description:
vnd_destroy: don't access freed memory.

diffstat:

 sys/dev/vnd.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 2f136aded9af -r f6987c0ef12a sys/dev/vnd.c
--- a/sys/dev/vnd.c     Sat Feb 04 10:47:04 2006 +0000
+++ b/sys/dev/vnd.c     Sat Feb 04 10:48:32 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vnd.c,v 1.135 2006/02/02 06:57:35 cube Exp $   */
+/*     $NetBSD: vnd.c,v 1.136 2006/02/04 10:48:32 yamt Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.135 2006/02/02 06:57:35 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.136 2006/02/04 10:48:32 yamt Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "fs_nfs.h"
@@ -306,11 +306,13 @@
 vnd_destroy(struct device *dev)
 {
        int error;
+       struct cfdata *cf;
 
+       cf = dev->dv_cfdata;
        error = config_detach(dev, 0);
        if (error)
                return error;
-       free(dev->dv_cfdata, M_DEVBUF);
+       free(cf, M_DEVBUF);
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index