diff options
| author | 2005-03-03 02:14:01 +0000 | |
|---|---|---|
| committer | 2005-03-03 02:14:01 +0000 | |
| commit | 85f6b51a658f0d3ef8400078c0c8eeb16ee27e24 (patch) | |
| tree | 9ecb4581e50708f07f5f98f71b6ac09e79c8879e | |
| parent | If we couldn't register an interrupt, don't abort attaching - we'll just (diff) | |
| download | wireguard-openbsd-85f6b51a658f0d3ef8400078c0c8eeb16ee27e24.tar.xz wireguard-openbsd-85f6b51a658f0d3ef8400078c0c8eeb16ee27e24.zip | |
Do not attempt to read past firmware data in rfx_initialize().
| -rw-r--r-- | sys/arch/sparc/dev/rfx.c | 6 | ||||
| -rw-r--r-- | sys/dev/sbus/rfx.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/sparc/dev/rfx.c b/sys/arch/sparc/dev/rfx.c index 36cc92ea6e1..38393645ed6 100644 --- a/sys/arch/sparc/dev/rfx.c +++ b/sys/arch/sparc/dev/rfx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rfx.c,v 1.6 2004/11/29 22:07:37 miod Exp $ */ +/* $OpenBSD: rfx.c,v 1.7 2005/03/03 02:14:01 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. @@ -512,7 +512,7 @@ rfx_initialize(struct rfx_softc *sc, struct rfx_config *cf) * Skip copyright notice */ data += RFX_INIT_OFFSET / sizeof(u_int32_t); - cnt = RFX_INIT_SIZE - RFX_INIT_OFFSET / sizeof(u_int32_t); + cnt = (RFX_INIT_SIZE - RFX_INIT_OFFSET) / sizeof(u_int32_t); cnt >>= 1; /* @@ -545,7 +545,7 @@ rfx_initialize(struct rfx_softc *sc, struct rfx_config *cf) } #ifdef DEBUG - if (cnt == 0) + if (cnt != 0) printf("%s: incoherent initialization data!\n"); #endif } diff --git a/sys/dev/sbus/rfx.c b/sys/dev/sbus/rfx.c index a1529ccea24..3fab276b61e 100644 --- a/sys/dev/sbus/rfx.c +++ b/sys/dev/sbus/rfx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rfx.c,v 1.2 2004/11/29 22:07:41 miod Exp $ */ +/* $OpenBSD: rfx.c,v 1.3 2005/03/03 02:14:02 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. @@ -539,7 +539,7 @@ rfx_initialize(struct rfx_softc *sc, struct sbus_attach_args *sa, * Skip copyright notice */ data += RFX_INIT_OFFSET / sizeof(u_int32_t); - cnt = RFX_INIT_SIZE - RFX_INIT_OFFSET / sizeof(u_int32_t); + cnt = (RFX_INIT_SIZE - RFX_INIT_OFFSET) / sizeof(u_int32_t); cnt >>= 1; /* @@ -572,7 +572,7 @@ rfx_initialize(struct rfx_softc *sc, struct sbus_attach_args *sa, } #ifdef DEBUG - if (cnt == 0) + if (cnt != 0) printf("%s: incoherent initialization data!\n"); #endif |
