From 10fbe6ad98bb4ef0ae2250b69c33c301a369f8ee Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 23 May 2013 14:15:52 +0000 Subject: [PATCH] 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. --- sys/dev/raidframe/rf_netbsdkintf.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 692a266de5fd..b6ab5c503d1b 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 -__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; }