mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Always initialize master_softc. This avoids panics in the idle loop due
to unitialized data if the APM support is compiled in and the probe fails.
This commit is contained in:
parent
638f228080
commit
b079435208
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14581
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
|
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
|
||||||
*
|
*
|
||||||
* $Id: apm.c,v 1.23 1995/12/27 16:16:02 bde Exp $
|
* $Id: apm.c,v 1.24 1996/03/11 06:48:48 nate Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "apm.h"
|
#include "apm.h"
|
||||||
@ -604,6 +604,12 @@ apmprobe(struct isa_device *dvp)
|
|||||||
{
|
{
|
||||||
int unit = dvp->id_unit;
|
int unit = dvp->id_unit;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXX - This is necessary here so that we don't panic in the idle
|
||||||
|
* loop because master_softc is unitialized.
|
||||||
|
*/
|
||||||
|
master_softc = &apm_softc[unit];
|
||||||
|
|
||||||
switch (apm_version) {
|
switch (apm_version) {
|
||||||
case APMINI_CANTFIND:
|
case APMINI_CANTFIND:
|
||||||
/* silent */
|
/* silent */
|
||||||
@ -712,7 +718,6 @@ apmattach(struct isa_device *dvp)
|
|||||||
#define APM_KERNBASE KERNBASE
|
#define APM_KERNBASE KERNBASE
|
||||||
struct apm_softc *sc = &apm_softc[unit];
|
struct apm_softc *sc = &apm_softc[unit];
|
||||||
|
|
||||||
master_softc = sc; /* XXX */
|
|
||||||
sc->initialized = 0;
|
sc->initialized = 0;
|
||||||
sc->active = 0;
|
sc->active = 0;
|
||||||
sc->halt_cpu = 1;
|
sc->halt_cpu = 1;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
|
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
|
||||||
*
|
*
|
||||||
* $Id: apm.c,v 1.23 1995/12/27 16:16:02 bde Exp $
|
* $Id: apm.c,v 1.24 1996/03/11 06:48:48 nate Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "apm.h"
|
#include "apm.h"
|
||||||
@ -604,6 +604,12 @@ apmprobe(struct isa_device *dvp)
|
|||||||
{
|
{
|
||||||
int unit = dvp->id_unit;
|
int unit = dvp->id_unit;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXX - This is necessary here so that we don't panic in the idle
|
||||||
|
* loop because master_softc is unitialized.
|
||||||
|
*/
|
||||||
|
master_softc = &apm_softc[unit];
|
||||||
|
|
||||||
switch (apm_version) {
|
switch (apm_version) {
|
||||||
case APMINI_CANTFIND:
|
case APMINI_CANTFIND:
|
||||||
/* silent */
|
/* silent */
|
||||||
@ -712,7 +718,6 @@ apmattach(struct isa_device *dvp)
|
|||||||
#define APM_KERNBASE KERNBASE
|
#define APM_KERNBASE KERNBASE
|
||||||
struct apm_softc *sc = &apm_softc[unit];
|
struct apm_softc *sc = &apm_softc[unit];
|
||||||
|
|
||||||
master_softc = sc; /* XXX */
|
|
||||||
sc->initialized = 0;
|
sc->initialized = 0;
|
||||||
sc->active = 0;
|
sc->active = 0;
|
||||||
sc->halt_cpu = 1;
|
sc->halt_cpu = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user