Module Name:    src
Committed By:   pgoyette
Date:           Sat Dec 26 21:50:43 UTC 2015

Modified Files:
        src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
Another use-after-free()


To generate a diff of this commit:
cvs rdiff -u -r1.329 -r1.330 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.329 src/sys/dev/raidframe/rf_netbsdkintf.c:1.330
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.329	Sat Dec 26 12:59:00 2015
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Sat Dec 26 21:50:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.329 2015/12/26 12:59:00 pgoyette Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.330 2015/12/26 21:50:43 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.329 2015/12/26 12:59:00 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.330 2015/12/26 21:50:43 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1039,6 +1039,7 @@ raid_detach_unlocked(struct raid_softc *
 
 	/* Free the softc */
 	aprint_normal_dev(rs->sc_dev, "detached\n");
+	raidunlock(rs);
 	raidput(rs);
 
 	return 0;
@@ -3938,9 +3939,6 @@ raid_detach(device_t self, int flags)
 
 	error = raid_detach_unlocked(rs);
 
-	if (error != 0)
-		raidunlock(rs);
-
 	return error;
 }
 

Reply via email to