Subject: Cardbus mapreg bug
To: None <tech-kern@NetBSD.org>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 04/21/2006 10:53:21
Could someone borrow me a pair of eyes?

The following patch seems neded to avoid uninitialized use of "handle"
later in the code. But unfortunately sc->sc_ioh/sc->sc_memh do not exists
(so this does not even compile).

Remember that bus_space_handle_t is an opaque type and we have no idea
how to initialize it (it is a struct on some archs).

How is this supposed to work?

Martin

Index: cardbus_map.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/cardbus_map.c,v
retrieving revision 1.20
diff -c -u -r1.20 cardbus_map.c
--- cardbus_map.c	21 Apr 2006 08:39:30 -0000	1.20
+++ cardbus_map.c	21 Apr 2006 08:48:55 -0000
@@ -271,6 +271,7 @@
 			status = 1;
 		}
 		bustag = sc->sc_iot;
+		handle = sc->sc_ioh;
 #if rbus
 		rbustag = sc->sc_rbus_iot;
 #endif
@@ -279,6 +280,7 @@
 			status = 1;
 		}
 		bustag = sc->sc_memt;
+		handle = sc->sc_memh;
 #if rbus
 		rbustag = sc->sc_rbus_memt;
 #endif