Don't call wdc_init_shadow_regs() before struct ata_channel is

properly initilized in wdc_obio_attach().
Fixes NULL pointer deref during boot.
This commit is contained in:
tsutsui 2006-10-05 09:34:52 +00:00
parent 886853e55b
commit 861b9568df
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdc_obio.c,v 1.21 2006/03/29 04:16:45 thorpej Exp $ */ /* $NetBSD: wdc_obio.c,v 1.22 2006/10/05 09:34:52 tsutsui Exp $ */
/* /*
* Copyright (c) 2002 Takeshi Shibagaki All rights reserved. * Copyright (c) 2002 Takeshi Shibagaki All rights reserved.
@ -32,7 +32,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.21 2006/03/29 04:16:45 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.22 2006/10/05 09:34:52 tsutsui Exp $");
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
@ -172,7 +172,6 @@ wdc_obio_attach(struct device *parent, struct device *self, void *aux)
return; return;
} }
} }
wdc_init_shadow_regs(&sc->sc_channel);
if (bus_space_subregion(wdr->cmd_iot, if (bus_space_subregion(wdr->cmd_iot,
wdr->cmd_baseioh, wdr->cmd_baseioh,
@ -230,6 +229,7 @@ wdc_obio_attach(struct device *parent, struct device *self, void *aux)
chp->ch_atac = &sc->sc_wdcdev.sc_atac; chp->ch_atac = &sc->sc_wdcdev.sc_atac;
chp->ch_queue = &sc->sc_chqueue; chp->ch_queue = &sc->sc_chqueue;
chp->ch_ndrive = 2; chp->ch_ndrive = 2;
wdc_init_shadow_regs(chp);
printf("\n"); printf("\n");