From 209161a4f6f7bef4df6fba23a6494d1e79bd2732 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 21 Sep 2005 20:08:24 +0000 Subject: [PATCH] Don't confuse the tuple code and the tuple length. Ooops. Since most CIS are tiny, this likely hasn't bit anybody yet... --- sys/dev/pccard/pccard_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pccard/pccard_device.c b/sys/dev/pccard/pccard_device.c index 3cee757cf1e..807ed798418 100644 --- a/sys/dev/pccard/pccard_device.c +++ b/sys/dev/pccard/pccard_device.c @@ -95,7 +95,7 @@ pccard_build_cis(const struct pccard_tuple *tuple, void *argp) cis->buffer[cis->len++] = tuple->code; return (0); } - if (cis->len + 2 + tuple->code > sizeof(cis->buffer)) + if (cis->len + 2 + tuple->length > sizeof(cis->buffer)) return (ENOSPC); cis->buffer[cis->len++] = tuple->code; cis->buffer[cis->len++] = tuple->length;