summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2013-05-23 14:15:52 +0000
committerchristos <christos@NetBSD.org>2013-05-23 14:15:52 +0000
commit944d4ac4ac2dc991c219c623e5ceff21a480c62c (patch)
treef31c55e464852b2919f1ec1f51689310b7180a0a /sys/dev/raidframe
parent30c1a6b94f355109d0546b0717e7489175159b5a (diff)
PR/47846: Frank Kardel: panic/lockups in raidframe during detach at shutdown
XXX: Fix this properly by using the memory allocated from the autoconf subsystem and use raidput in all the places needed.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 692a266de5f..b6ab5c503d1 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.302 2013/04/29 21:21:10 christos Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.303 2013/05/23 14:15:52 christos 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.302 2013/04/29 21:21:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.303 2013/05/23 14:15:52 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -3841,7 +3841,10 @@ static int
raid_detach(device_t self, int flags)
{
int error;
- struct raid_softc *rs = device_private(self);
+ struct raid_softc *rs = raidget(device_unit(self));
+
+ if (rs == NULL)
+ return ENXIO;
if ((error = raidlock(rs)) != 0)
return (error);
@@ -3850,6 +3853,8 @@ raid_detach(device_t self, int flags)
raidunlock(rs);
+ /* XXXkd: raidput(rs) ??? */
+
return error;
}