diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2005-12-07 12:42:17 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2005-12-07 12:42:17 +0000 |
commit | c001ceec0469864ebf5accd9ed8c57d194945610 (patch) | |
tree | eb2c0c8b641757d7533edeaf85b656a6a4c1007a /sys/dev/cardbus/cardbus.c | |
parent | 841e89e85b1b7994caa57068d4bf50127b86b3a7 (diff) |
o do not break after first iteration but when we found a match.
o try to read the whole cis (but not more than len bytes) instead of the
first 256 bytes.
first one spotted by lint. mickey@, krw@ and deraadt@ ok.
Diffstat (limited to 'sys/dev/cardbus/cardbus.c')
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index b292503791c..acc929f12ce 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbus.c,v 1.31 2005/09/26 22:43:18 deraadt Exp $ */ +/* $OpenBSD: cardbus.c,v 1.32 2005/12/07 12:42:16 fgsch Exp $ */ /* $NetBSD: cardbus.c,v 1.24 2000/04/02 19:11:37 mycroft Exp $ */ /* @@ -235,10 +235,10 @@ cardbus_read_tuples(struct cardbus_attach_args *ca, cardbusreg_t cis_ptr, CARDBUS_CIS_ASI_ROM_IMAGE(cis_ptr)) { bus_space_read_region_1(p->romt, p->romh, CARDBUS_CIS_ADDR(cis_ptr), - tuples, 256); + tuples, MIN(p->image_size, len)); found++; + break; } - break; } out: |