From 14d8754e342dbd05ee775ef31488e9a8ae797d4c Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Thu, 9 Aug 2018 09:56:21 -0500 Subject: [PATCH] Completely clear out conference buffers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an error and quiets the following warning pointed out by gcc 7.3.0: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] memset(chan->conflast, 0, DAHDI_MAX_CHUNKSIZE); Previously only the first half of the conference buffers were cleared out. --- drivers/dahdi/dahdi-base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 618754d..c6f95f0 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -5709,9 +5709,9 @@ static int dahdi_ioctl_setconf(struct file *file, unsigned long data) } /* if changing confs, clear last added info */ if (conf.confno != chan->confna) { - memset(chan->conflast, 0, DAHDI_MAX_CHUNKSIZE); - memset(chan->conflast1, 0, DAHDI_MAX_CHUNKSIZE); - memset(chan->conflast2, 0, DAHDI_MAX_CHUNKSIZE); + memset(chan->conflast, 0, sizeof(chan->conflast)); + memset(chan->conflast1, 0, sizeof(chan->conflast1)); + memset(chan->conflast2, 0, sizeof(chan->conflast2)); } oldconf = chan->confna; /* save old conference number */ chan->confna = conf.confno; /* set conference number */