From 7aeddaf315e114aed44d6c66e0bb20c62a638262 Mon Sep 17 00:00:00 2001 From: Vaishnavi Kommaraju Date: Wed, 21 Feb 2018 14:58:47 +0530 Subject: [PATCH] ASoC: wcd934x-dsp-cntl: Limit array size of val Limit size of val to WCD_MISCDEV_CMD_MAX_LEN to avoid stack overflow. CRs-Fixed: 2177167 Change-Id: I5d2b91e92305d6a485b2e8f959036504f0f55b13 Signed-off-by: Vaishnavi Kommaraju --- asoc/codecs/wcd934x/wcd934x-dsp-cntl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asoc/codecs/wcd934x/wcd934x-dsp-cntl.c b/asoc/codecs/wcd934x/wcd934x-dsp-cntl.c index 35e12244cb..58987ad02c 100644 --- a/asoc/codecs/wcd934x/wcd934x-dsp-cntl.c +++ b/asoc/codecs/wcd934x/wcd934x-dsp-cntl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1007,7 +1007,7 @@ static ssize_t wcd_miscdev_write(struct file *filep, const char __user *ubuf, { struct wcd_dsp_cntl *cntl = container_of(filep->private_data, struct wcd_dsp_cntl, miscdev); - char val[count]; + char val[WCD_MISCDEV_CMD_MAX_LEN]; bool vote; int ret = 0;