diff options
author | Constantine A. Murenin <cnst@cvs.openbsd.org> | 2007-07-01 21:48:58 +0000 |
---|---|---|
committer | Constantine A. Murenin <cnst@cvs.openbsd.org> | 2007-07-01 21:48:58 +0000 |
commit | 26ffceae666900d3c4ad58fd64e9609a0bf32a68 (patch) | |
tree | b86b18689db98a13a30b58a6983152c8bffe7e53 /sys/dev/isa | |
parent | b5c5ac60b27e4cff9f7ec7c9b3d9214f1560ce3b (diff) |
fix potential crash due to wrong ca_devsize; whilst here, also fix iobase type; ok grange, kettenis
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/lm78_isa.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/isa/lm78_isa.c b/sys/dev/isa/lm78_isa.c index adf4522b780..8ee1bf6efaf 100644 --- a/sys/dev/isa/lm78_isa.c +++ b/sys/dev/isa/lm78_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lm78_isa.c,v 1.1 2006/01/28 11:25:17 kettenis Exp $ */ +/* $OpenBSD: lm78_isa.c,v 1.2 2007/07/01 21:48:57 cnst Exp $ */ /* * Copyright (c) 2005, 2006 Mark Kettenis @@ -53,7 +53,7 @@ u_int8_t lm_isa_readreg(struct lm_softc *, int); void lm_isa_writereg(struct lm_softc *, int, int); struct cfattach lm_isa_ca = { - sizeof(struct lm_softc), + sizeof(struct lm_isa_softc), lm_isa_match, lm_isa_attach }; @@ -62,9 +62,10 @@ int lm_isa_match(struct device *parent, void *match, void *aux) { bus_space_tag_t iot; + bus_addr_t iobase; bus_space_handle_t ioh; struct isa_attach_args *ia = aux; - int iobase, banksel, vendid, chipid, addr; + int banksel, vendid, chipid, addr; iot = ia->ia_iot; iobase = ia->ipa_io[0].base; @@ -136,11 +137,12 @@ lm_isa_attach(struct device *parent, struct device *self, void *aux) struct lm_isa_softc *sc = (struct lm_isa_softc *)self; struct isa_attach_args *ia = aux; struct lm_softc *lmsc; - int iobase, i; + bus_addr_t iobase; + int i; u_int8_t sbusaddr; sc->sc_iot = ia->ia_iot; - iobase = ia->ipa_io[0].base; + iobase = ia->ipa_io[0].base; if (bus_space_map(sc->sc_iot, iobase, 8, 0, &sc->sc_ioh)) { printf(": can't map i/o space\n"); |