Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Avoid calling bufq_free() from critical section.
details: https://anonhg.NetBSD.org/src/rev/e598bcbdb3fd
branches: trunk
changeset: 349001:e598bcbdb3fd
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sun Nov 20 02:34:27 2016 +0000
description:
Avoid calling bufq_free() from critical section.
diffstat:
sys/arch/emips/ebus/flash_ebus.c | 6 +++---
sys/dev/ata/wd.c | 6 +++---
sys/dev/ccd.c | 7 ++++---
3 files changed, 10 insertions(+), 9 deletions(-)
diffs (91 lines):
diff -r 72c733d2f2f3 -r e598bcbdb3fd sys/arch/emips/ebus/flash_ebus.c
--- a/sys/arch/emips/ebus/flash_ebus.c Sun Nov 20 02:27:56 2016 +0000
+++ b/sys/arch/emips/ebus/flash_ebus.c Sun Nov 20 02:34:27 2016 +0000
@@ -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 <sys/cdefs.h> /* 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 @@
/* 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 -r 72c733d2f2f3 -r e598bcbdb3fd sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c Sun Nov 20 02:27:56 2016 +0000
+++ b/sys/dev/ata/wd.c Sun Nov 20 02:34:27 2016 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
/* 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 -r 72c733d2f2f3 -r e598bcbdb3fd sys/dev/ccd.c
--- a/sys/dev/ccd.c Sun Nov 20 02:27:56 2016 +0000
+++ b/sys/dev/ccd.c Sun Nov 20 02:34:27 2016 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
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. */
Home |
Main Index |
Thread Index |
Old Index