PR# port-i386/40143: Viewing an mpeg transport stream with mplayer causes crash

Not directly related to the PR but this bug was discovered while testing.

In azalia_stream_halt, invalidate the intr ptr to prevent a race condition
where azalia_stream_intr can jump off into lala land during stream shutdown.
This commit is contained in:
jmcneill 2009-02-25 15:46:34 +00:00
parent 7b2f022cd6
commit 079289a3e6
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: azalia.c,v 1.66 2008/12/17 15:35:17 cegger Exp $ */ /* $NetBSD: azalia.c,v 1.67 2009/02/25 15:46:34 jmcneill Exp $ */
/*- /*-
* Copyright (c) 2005 The NetBSD Foundation, Inc. * Copyright (c) 2005 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.66 2008/12/17 15:35:17 cegger Exp $"); __KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.67 2009/02/25 15:46:34 jmcneill Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/device.h> #include <sys/device.h>
@ -2074,6 +2074,7 @@ azalia_stream_halt(stream_t *this)
if (this->bdlist.addr == NULL) if (this->bdlist.addr == NULL)
return EINVAL; return EINVAL;
this->intr = this->intr_arg = NULL;
ctl = STR_READ_2(this, CTL); ctl = STR_READ_2(this, CTL);
ctl &= ~(HDA_SD_CTL_DEIE | HDA_SD_CTL_FEIE | HDA_SD_CTL_IOCE | HDA_SD_CTL_RUN); ctl &= ~(HDA_SD_CTL_DEIE | HDA_SD_CTL_FEIE | HDA_SD_CTL_IOCE | HDA_SD_CTL_RUN);
STR_WRITE_2(this, CTL, ctl); STR_WRITE_2(this, CTL, ctl);