In wddetach(), avoid a crash by destroying the callout sc_restart_ch.

This commit is contained in:
dyoung 2008-12-05 18:20:19 +00:00
parent dbc045b3d9
commit 20baa33fe2
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd.c,v 1.363 2008/06/08 18:34:06 tsutsui Exp $ */
/* $NetBSD: wd.c,v 1.364 2008/12/05 18:20:19 dyoung Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.363 2008/06/08 18:34:06 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.364 2008/12/05 18:20:19 dyoung Exp $");
#include "opt_ata.h"
@ -504,6 +504,8 @@ wddetach(struct device *self, int flags)
rnd_detach_source(&sc->rnd_source);
#endif
callout_destroy(&sc->sc_restart_ch);
sc->drvp->drive_flags = 0; /* no drive any more here */
return (0);