summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorpgoyette <pgoyette@NetBSD.org>2015-12-26 21:50:43 +0000
committerpgoyette <pgoyette@NetBSD.org>2015-12-26 21:50:43 +0000
commit5af37bd9ae607fb212f9ffc7ca6ba31fc7293db3 (patch)
tree2486363e321ce391066ffcd51276b2c26e55a29c /sys/dev/raidframe
parent8a04c845276e0bf6e71ec79bed5e8b7f47355ec0 (diff)
Another use-after-free()
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c8
1 files changed, 3 insertions, 5 deletions
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 <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 *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;
}