-/* $OpenBSD: est.c,v 1.31 2014/05/10 18:59:29 guenther Exp $ */
+/* $OpenBSD: est.c,v 1.32 2014/05/23 03:30:41 guenther Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
return;
if (est_fqlist->n < 2)
- return;
+ goto nospeedstep;
low = est_fqlist->table[est_fqlist->n - 1].mhz;
high = est_fqlist->table[0].mhz;
if (low == high)
- return;
+ goto nospeedstep;
perflevel = (cpuspeed - low) * 100 / (high - low);
cpu_setperf = est_setperf;
setperf_prio = 3;
+
+ return;
+
+nospeedstep:
+ free(est_fqlist->table, M_DEVBUF);
+ free(est_fqlist, M_DEVBUF);
}
void
-/* $OpenBSD: est.c,v 1.41 2014/05/10 18:59:29 guenther Exp $ */
+/* $OpenBSD: est.c,v 1.42 2014/05/23 03:30:41 guenther Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
return;
if (est_fqlist->n < 2)
- return;
+ goto nospeedstep;
low = est_fqlist->table[est_fqlist->n - 1].mhz;
high = est_fqlist->table[0].mhz;
if (low == high)
- return;
+ goto nospeedstep;
perflevel = (cpuspeed - low) * 100 / (high - low);
cpu_setperf = est_setperf;
setperf_prio = 3;
+
+ return;
+
+nospeedstep:
+ /*
+ * While est_fqlist can point into the static est_cpus[],
+ * it can't fail in that case and therefore can't reach here.
+ */
+ free(est_fqlist->table, M_DEVBUF);
+ free(est_fqlist, M_DEVBUF);
}
void