lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1399380097-11908-1-git-send-email-martink@posteo.de>
Date:	Tue,  6 May 2014 14:41:37 +0200
From:	Martin Kepplinger <martink@...teo.de>
To:	gregkh@...uxfoundation.org
Cc:	lidza.louina@...il.com, driverdev-devel@...uxdriverproject.org,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Martin Kepplinger <martink@...teo.de>
Subject: [PATCH] staging: dgnc: fix compile warning frame size is larger than 1024 bytes

fix following warning by dynamically allocating memory:
dgnc_tty.c:583:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Signed-off-by: Martin Kepplinger <martink@...teo.de>
---
This is more of a question. Is this a desired solution to fixing such a
frame size warning?

thanks,
                martin

 drivers/staging/dgnc/dgnc_tty.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index f0b17c3..1c78cc2 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -481,8 +481,8 @@ void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar *text, uchar *buf, int
 	int nbuf;
 	int i;
 	int tmpbuflen;
-	char tmpbuf[TMPBUFLEN];
-	char *p = tmpbuf;
+	char *tmpbuf;
+	char *p;
 	int too_much_data;
 
 	/* Leave if sniff not open */
@@ -492,6 +492,13 @@ void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar *text, uchar *buf, int
 	do_gettimeofday(&tv);
 
 	/* Create our header for data dump */
+	tmpbuf = kmalloc(TMPBUFLEN, GFP_KERNEL);
+	if (!tmpbuf) {
+		pr_err("dgnc: memory allocation error\n");
+		return;
+	}
+	p = tmpbuf;
+
 	p += sprintf(p, "<%ld %ld><%s><", tv.tv_sec, tv.tv_usec, text);
 	tmpbuflen = p - tmpbuf;
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ