diff options
author | 2003-04-06 16:59:33 +0000 | |
---|---|---|
committer | 2003-04-06 16:59:33 +0000 | |
commit | 0da620c00a31f1d600b2fad64125c0e8592f6f03 (patch) | |
tree | 0830df895e356cf1f6f510ef6b957424399de1be | |
parent | Some easy strcpy elimination. (diff) | |
download | wireguard-openbsd-0da620c00a31f1d600b2fad64125c0e8592f6f03.tar.xz wireguard-openbsd-0da620c00a31f1d600b2fad64125c0e8592f6f03.zip |
When encountering an older or unexpected model this driver can not handle,
return early in attach() rather than panic.
-rw-r--r-- | sys/arch/sparc/dev/vigra.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/sparc/dev/vigra.c b/sys/arch/sparc/dev/vigra.c index 822113aee22..31ab54e64c9 100644 --- a/sys/arch/sparc/dev/vigra.c +++ b/sys/arch/sparc/dev/vigra.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vigra.c,v 1.5 2002/11/06 21:06:20 miod Exp $ */ +/* $OpenBSD: vigra.c,v 1.6 2003/04/06 16:59:33 miod Exp $ */ /* * Copyright (c) 2002 Miodrag Vallat. All rights reserved. @@ -206,9 +206,11 @@ vigraattach(parent, self, args) isconsole = node == fbnode; - if (ca->ca_ra.ra_nreg < VIGRA_NREG) - panic("expected %d registers, got %d", - VIGRA_NREG, ca->ca_ra.ra_nreg); + if (ca->ca_ra.ra_nreg < VIGRA_NREG) { + printf("\n%s: expected %d registers, got %d", + self->dv_xname, VIGRA_NREG, ca->ca_ra.ra_nreg); + return; + } sc->sc_regs = mapiodev(&ca->ca_ra.ra_reg[VIGRA_REG_G300], 0, sizeof(*sc->sc_regs)); |