diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c index 8d2059b64758..7d80108d7ac1 100644 --- a/sys/dev/cardbus/cardbus_cis.c +++ b/sys/dev/cardbus/cardbus_cis.c @@ -565,9 +565,9 @@ void cardbus_cis_free(device_t dev, struct cis_tupleinfo *buff, int* nret) { int i; - for (i = 0; i < nret; i++) + for (i = 0; i < *nret; i++) free(buff[i].data, M_DEVBUF); - if (nret > 0) + if (*nret > 0) free(buff, M_DEVBUF); }