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>
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);
* function was probably called by the interrupt/timer routines!
*/
if (n == 0)
- return;
+ goto exit;
/*
* Copy as much data as will fit.
}
} while (too_much_data);
+
+exit:
+ kfree(tmpbuf);
}