diff options
author | Konrad Zapalowicz <bergo.torino@gmail.com> | 2014-08-06 14:21:21 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-16 12:23:13 -0700 |
commit | ea6e9dea2e72a7abd146a2c5bab726b27f34b36c (patch) | |
tree | 784e49ea37af16f4b29fd670ec9e8c04898d07ff /drivers/staging/dgnc | |
parent | 338fd80f9da7772ff3b957adb7ae1ed4615c484c (diff) | |
download | linux-ea6e9dea2e72a7abd146a2c5bab726b27f34b36c.tar.bz2 |
staging: dgnc: Fix frame size is larger than 1024B
This comit fixes the following sparse warnign:
drivers/staging/dgnc/dgnc_tty.c:572:1:
warning: the frame size of 1060 bytes is larger than 1024 bytes
[-Wframe-larger-than=]
This was caused by having buffer as an automatic variable. This commit
moves it from the stack to the heap.
Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgnc')
-rw-r--r-- | drivers/staging/dgnc/dgnc_tty.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index c712b431f969..2dc78f79ec49 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -471,13 +471,18 @@ 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; + tmpbuf = kzalloc(TMPBUFLEN, GFP_KERNEL); + if (!tmpbuf) + return; + p = tmpbuf; + /* Leave if sniff not open */ if (!(ch->ch_sniff_flags & SNIFF_OPEN)) - return; + goto exit; do_gettimeofday(&tv); @@ -524,7 +529,7 @@ void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar *text, uchar *buf, int * function was probably called by the interrupt/timer routines! */ if (n == 0) - return; + goto exit; /* * Copy as much data as will fit. @@ -569,6 +574,9 @@ void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar *text, uchar *buf, int } } while (too_much_data); + +exit: + kfree(tmpbuf); } |