diff --git a/sys/arch/emips/ebus/flash_ebus.c b/sys/arch/emips/ebus/flash_ebus.c index 14be5104a010..893e9bec857f 100644 --- a/sys/arch/emips/ebus/flash_ebus.c +++ b/sys/arch/emips/ebus/flash_ebus.c @@ -1,4 +1,4 @@ -/* $NetBSD: flash_ebus.c,v 1.18 2015/12/13 19:36:40 christos Exp $ */ +/* $NetBSD: flash_ebus.c,v 1.19 2016/11/20 02:34:27 pgoyette Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.18 2015/12/13 19:36:40 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.19 2016/11/20 02:34:27 pgoyette Exp $"); /* Driver for the Intel 28F320/640/128 (J3A150) StrataFlash memory device * Extended to include the Intel JS28F256P30T95. @@ -1524,10 +1524,10 @@ eflashdetach(device_t self, int flags) /* Kill off any queued buffers. */ bufq_drain(sc->sc_q); - bufq_free(sc->sc_q); /*sc->atabus->ata_killpending(sc->drvp);*/ splx(s); + bufq_free(sc->sc_q); /* Detach disk. */ disk_detach(&sc->sc_dk); diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index 99ea9b0c1f5e..a7c58bf6a911 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.426 2016/08/05 06:54:22 christos Exp $ */ +/* $NetBSD: wd.c,v 1.427 2016/11/20 02:35:19 pgoyette Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.426 2016/08/05 06:54:22 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.427 2016/11/20 02:35:19 pgoyette Exp $"); #include "opt_ata.h" @@ -482,12 +482,12 @@ wddetach(device_t self, int flags) /* Kill off any queued buffers. */ bufq_drain(sc->sc_q); - bufq_free(sc->sc_q); sc->atabus->ata_killpending(sc->drvp); if (flags & DETACH_POWEROFF) wd_standby(sc, AT_POLL); splx(s); + bufq_free(sc->sc_q); /* Detach disk. */ disk_detach(&sc->sc_dk); diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c index 95767f797947..af3f3e5b23cb 100644 --- a/sys/dev/ccd.c +++ b/sys/dev/ccd.c @@ -1,4 +1,4 @@ -/* $NetBSD: ccd.c,v 1.167 2016/08/07 02:40:41 pgoyette Exp $ */ +/* $NetBSD: ccd.c,v 1.168 2016/11/20 02:35:19 pgoyette Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc. @@ -88,7 +88,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.167 2016/08/07 02:40:41 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.168 2016/11/20 02:35:19 pgoyette Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -1291,8 +1291,9 @@ ccdioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) kmem_free(vpp, ccio->ccio_ndisks * sizeof(*vpp)); kmem_free(cpp, ccio->ccio_ndisks * sizeof(*cpp)); disk_detach(&cs->sc_dkdev); + mutex_exit(&cs->sc_dvlock); bufq_free(cs->sc_bufq); - goto out; + return error; } /* We can free the temporary variables now. */