Douglas Gilbert wrote: > Hannes Reinecke wrote: >> Douglas Gilbert wrote: >>> Hannes, >>> Here is my counter patch for you to consider. >>> I suspect my machine was running into stack >>> problems so I moved some arrays onto the heap. >>> >> Ah. Good. To tell the truth I was a bit concerned once I've >> discovered that all information pages are infact statically allocated ... > > I wasn't aware that statically allocated data (file or local > scope) would add to stack problems on a driver loaded as a > module. The arrays I moved to the heap were "auto" (i.e. non-static). > [ .. ] > > Over zealous error processing .... > I have made this mistake often enough, along with > many others, so hopefully some readers will take note: > I know. Been there before, too :-) > [ .. ] > So the "if (alloc_len < 4 + (11 * 2))" block should be > removed. Also the "if (alloc_len < n)" block should be > removed and "min" should be (possibly a cleaner version of): > min(min(alloc_len, n), SDEBUG_MAX_TGTPGS_ARR_SZ)) > Ok, did so. And returned the proper (relative !) port number in the port descriptor list. Is this more to your liking? Cheers, Hannes -- Dr. Hannes Reinecke hare@suse.de SuSE Linux Products GmbH S390 & zSeries Maxfeldstraße 5 +49 911 74053 688 90409 Nürnberg http://www.suse.de