Module Name: src Committed By: christos Date: Fri Dec 9 16:22:09 UTC 2016
Modified Files: src/sys/dev/ofisa: ess_ofisa.c Log Message: don't use alloca To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/ofisa/ess_ofisa.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ofisa/ess_ofisa.c diff -u src/sys/dev/ofisa/ess_ofisa.c:1.25 src/sys/dev/ofisa/ess_ofisa.c:1.26 --- src/sys/dev/ofisa/ess_ofisa.c:1.25 Sat May 22 12:35:00 2010 +++ src/sys/dev/ofisa/ess_ofisa.c Fri Dec 9 11:22:09 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ess_ofisa.c,v 1.25 2010/05/22 16:35:00 tsutsui Exp $ */ +/* $NetBSD: ess_ofisa.c,v 1.26 2016/12/09 16:22:09 christos Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ess_ofisa.c,v 1.25 2010/05/22 16:35:00 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ess_ofisa.c,v 1.26 2016/12/09 16:22:09 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -86,7 +86,6 @@ ess_ofisa_attach(device_t parent, device struct ofisa_intr_desc intr[2]; struct ofisa_dma_desc dma[2]; int n, ndrq; - char *model; sc->sc_dev = self; @@ -164,7 +163,9 @@ ess_ofisa_attach(device_t parent, device n = OF_getproplen(aa->oba.oba_phandle, "model"); if (n > 0) { - model = alloca(n); + char model[256]; + if (n > 256) + n = 256; if (OF_getprop(aa->oba.oba_phandle, "model", model, n) == n) { aprint_normal(": %s\n", model); aprint_normal_dev(self, "");