From c001ceec0469864ebf5accd9ed8c57d194945610 Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" Date: Wed, 7 Dec 2005 12:42:17 +0000 Subject: 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. --- sys/dev/cardbus/cardbus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys') 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: -- cgit v1.2.3