From 5af37bd9ae607fb212f9ffc7ca6ba31fc7293db3 Mon Sep 17 00:00:00 2001 From: pgoyette Date: Sat, 26 Dec 2015 21:50:43 +0000 Subject: Another use-after-free() --- sys/dev/raidframe/rf_netbsdkintf.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/dev/raidframe') diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 404f2955a91..9d2bcd64079 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -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 -__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 *rs) /* 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; } -- cgit