mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
214 lines
9.5 KiB
Diff
214 lines
9.5 KiB
Diff
From 3baefa3af45c0ab1ca8391821ea55b9049a3a3da Mon Sep 17 00:00:00 2001
|
|
From: Laxminath Kasam <lkasam@codeaurora.org>
|
|
Date: Mon, 29 Aug 2016 21:58:32 +0530
|
|
Subject: misc: qcom: qdsp6v2: initialize config_32
|
|
|
|
Not all members of config_32 are set before they are used which
|
|
might lead to invalid values being passed and used. To fix this
|
|
issue initialize all member variables of struct config_32 to 0 before
|
|
assigning specific values individually.
|
|
|
|
CRs-Fixed: 1058826
|
|
Change-Id: Ifea3a6e8bf45481c65a4455ee64318304798fee2
|
|
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
|
|
---
|
|
drivers/misc/qcom/qdsp6v2/aac_in.c | 4 +++-
|
|
drivers/misc/qcom/qdsp6v2/amrnb_in.c | 4 +++-
|
|
drivers/misc/qcom/qdsp6v2/amrwb_in.c | 2 ++
|
|
drivers/misc/qcom/qdsp6v2/audio_alac.c | 2 ++
|
|
drivers/misc/qcom/qdsp6v2/audio_amrwbplus.c | 4 ++++
|
|
drivers/misc/qcom/qdsp6v2/audio_ape.c | 2 ++
|
|
drivers/misc/qcom/qdsp6v2/audio_hwacc_effects.c | 2 ++
|
|
drivers/misc/qcom/qdsp6v2/audio_multi_aac.c | 2 ++
|
|
drivers/misc/qcom/qdsp6v2/audio_utils_aio.c | 1 +
|
|
drivers/misc/qcom/qdsp6v2/audio_wmapro.c | 2 ++
|
|
drivers/misc/qcom/qdsp6v2/evrc_in.c | 4 +++-
|
|
drivers/misc/qcom/qdsp6v2/qcelp_in.c | 4 +++-
|
|
12 files changed, 29 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/aac_in.c b/drivers/misc/qcom/qdsp6v2/aac_in.c
|
|
index c9d5dbb..7176c114 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/aac_in.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/aac_in.c
|
|
@@ -1,5 +1,5 @@
|
|
/*
|
|
- * Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
|
|
+ * Copyright (c) 2010-2016, 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
|
|
@@ -421,6 +421,8 @@ static long aac_in_compat_ioctl(struct file *file, unsigned int cmd,
|
|
struct msm_audio_aac_enc_config cfg;
|
|
struct msm_audio_aac_enc_config32 cfg_32;
|
|
|
|
+ memset(&cfg_32, 0, sizeof(cfg_32));
|
|
+
|
|
cmd = AUDIO_GET_AAC_ENC_CONFIG;
|
|
rc = aac_in_ioctl_shared(file, cmd, &cfg);
|
|
if (rc) {
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/amrnb_in.c b/drivers/misc/qcom/qdsp6v2/amrnb_in.c
|
|
index eb92137..9d4cf5c 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/amrnb_in.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/amrnb_in.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Copyright (c) 2010-2012, 2014 The Linux Foundation. All rights reserved.
|
|
+/* Copyright (c) 2010-2016 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
|
|
@@ -221,6 +221,8 @@ static long amrnb_in_compat_ioctl(struct file *file,
|
|
struct msm_audio_amrnb_enc_config_v2 *amrnb_config;
|
|
struct msm_audio_amrnb_enc_config_v2_32 amrnb_config_32;
|
|
|
|
+ memset(&amrnb_config_32, 0, sizeof(amrnb_config_32));
|
|
+
|
|
amrnb_config =
|
|
(struct msm_audio_amrnb_enc_config_v2 *)audio->enc_cfg;
|
|
amrnb_config_32.band_mode = amrnb_config->band_mode;
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/amrwb_in.c b/drivers/misc/qcom/qdsp6v2/amrwb_in.c
|
|
index 9bd19d9..43dcbd5 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/amrwb_in.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/amrwb_in.c
|
|
@@ -217,6 +217,8 @@ static long amrwb_in_compat_ioctl(struct file *file,
|
|
struct msm_audio_amrwb_enc_config *amrwb_config;
|
|
struct msm_audio_amrwb_enc_config_32 amrwb_config_32;
|
|
|
|
+ memset(&amrwb_config_32, 0, sizeof(amrwb_config_32));
|
|
+
|
|
amrwb_config =
|
|
(struct msm_audio_amrwb_enc_config *)audio->enc_cfg;
|
|
amrwb_config_32.band_mode = amrwb_config->band_mode;
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/audio_alac.c b/drivers/misc/qcom/qdsp6v2/audio_alac.c
|
|
index 7b18e3a..646d37d 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/audio_alac.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/audio_alac.c
|
|
@@ -196,6 +196,8 @@ static long audio_compat_ioctl(struct file *file, unsigned int cmd,
|
|
struct msm_audio_alac_config *alac_config;
|
|
struct msm_audio_alac_config_32 alac_config_32;
|
|
|
|
+ memset(&alac_config_32, 0, sizeof(alac_config_32));
|
|
+
|
|
alac_config = (struct msm_audio_alac_config *)audio->codec_cfg;
|
|
alac_config_32.frameLength = alac_config->frameLength;
|
|
alac_config_32.compatVersion =
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/audio_amrwbplus.c b/drivers/misc/qcom/qdsp6v2/audio_amrwbplus.c
|
|
index e96e23a..3c3f1c4 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/audio_amrwbplus.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/audio_amrwbplus.c
|
|
@@ -205,6 +205,10 @@ static long audio_compat_ioctl(struct file *file, unsigned int cmd,
|
|
struct msm_audio_amrwbplus_config_v2 *amrwbplus_config;
|
|
struct msm_audio_amrwbplus_config_v2_32
|
|
amrwbplus_config_32;
|
|
+
|
|
+ memset(&amrwbplus_config_32, 0,
|
|
+ sizeof(amrwbplus_config_32));
|
|
+
|
|
amrwbplus_config =
|
|
(struct msm_audio_amrwbplus_config_v2 *)
|
|
audio->codec_cfg;
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/audio_ape.c b/drivers/misc/qcom/qdsp6v2/audio_ape.c
|
|
index 8d78124..7371512 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/audio_ape.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/audio_ape.c
|
|
@@ -180,6 +180,8 @@ static long audio_compat_ioctl(struct file *file, unsigned int cmd,
|
|
struct msm_audio_ape_config *ape_config;
|
|
struct msm_audio_ape_config_32 ape_config_32;
|
|
|
|
+ memset(&ape_config_32, 0, sizeof(ape_config_32));
|
|
+
|
|
ape_config = (struct msm_audio_ape_config *)audio->codec_cfg;
|
|
ape_config_32.compatibleVersion = ape_config->compatibleVersion;
|
|
ape_config_32.compressionLevel =
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/audio_hwacc_effects.c b/drivers/misc/qcom/qdsp6v2/audio_hwacc_effects.c
|
|
index 6843fd7..940fd08 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/audio_hwacc_effects.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/audio_hwacc_effects.c
|
|
@@ -630,6 +630,8 @@ static long audio_effects_compat_ioctl(struct file *file, unsigned int cmd,
|
|
case AUDIO_EFFECTS_GET_BUF_AVAIL32: {
|
|
struct msm_hwacc_buf_avail32 buf_avail;
|
|
|
|
+ memset(&buf_avail, 0, sizeof(buf_avail));
|
|
+
|
|
buf_avail.input_num_avail = atomic_read(&effects->in_count);
|
|
buf_avail.output_num_avail = atomic_read(&effects->out_count);
|
|
pr_debug("%s: write buf avail: %d, read buf avail: %d\n",
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/audio_multi_aac.c b/drivers/misc/qcom/qdsp6v2/audio_multi_aac.c
|
|
index 858f7bc..4ac74a5 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/audio_multi_aac.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/audio_multi_aac.c
|
|
@@ -302,6 +302,8 @@ static long audio_compat_ioctl(struct file *file, unsigned int cmd,
|
|
struct msm_audio_aac_config *aac_config;
|
|
struct msm_audio_aac_config32 aac_config_32;
|
|
|
|
+ memset(&aac_config_32, 0, sizeof(aac_config_32));
|
|
+
|
|
aac_config = (struct msm_audio_aac_config *)audio->codec_cfg;
|
|
aac_config_32.format = aac_config->format;
|
|
aac_config_32.audio_object = aac_config->audio_object;
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/audio_utils_aio.c b/drivers/misc/qcom/qdsp6v2/audio_utils_aio.c
|
|
index 4edc814..2b0af2e 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/audio_utils_aio.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/audio_utils_aio.c
|
|
@@ -2038,6 +2038,7 @@ static long audio_aio_compat_ioctl(struct file *file, unsigned int cmd,
|
|
audio->buf_cfg.frames_per_buf);
|
|
|
|
mutex_lock(&audio->lock);
|
|
+ memset(&cfg_32, 0, sizeof(cfg_32));
|
|
cfg_32.meta_info_enable = audio->buf_cfg.meta_info_enable;
|
|
cfg_32.frames_per_buf = audio->buf_cfg.frames_per_buf;
|
|
if (copy_to_user((void *)arg, &cfg_32,
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/audio_wmapro.c b/drivers/misc/qcom/qdsp6v2/audio_wmapro.c
|
|
index 2c88e77..d389d9b 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/audio_wmapro.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/audio_wmapro.c
|
|
@@ -217,6 +217,8 @@ static long audio_compat_ioctl(struct file *file, unsigned int cmd,
|
|
struct msm_audio_wmapro_config *wmapro_config;
|
|
struct msm_audio_wmapro_config32 wmapro_config_32;
|
|
|
|
+ memset(&wmapro_config_32, 0, sizeof(wmapro_config_32));
|
|
+
|
|
wmapro_config =
|
|
(struct msm_audio_wmapro_config *)audio->codec_cfg;
|
|
wmapro_config_32.armdatareqthr = wmapro_config->armdatareqthr;
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/evrc_in.c b/drivers/misc/qcom/qdsp6v2/evrc_in.c
|
|
index 2f931be..aab8e27 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/evrc_in.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/evrc_in.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
|
|
+/* Copyright (c) 2010-2016, 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
|
|
@@ -224,6 +224,8 @@ static long evrc_in_compat_ioctl(struct file *file,
|
|
struct msm_audio_evrc_enc_config32 cfg_32;
|
|
struct msm_audio_evrc_enc_config *enc_cfg;
|
|
|
|
+ memset(&cfg_32, 0, sizeof(cfg_32));
|
|
+
|
|
enc_cfg = audio->enc_cfg;
|
|
cfg_32.cdma_rate = enc_cfg->cdma_rate;
|
|
cfg_32.min_bit_rate = enc_cfg->min_bit_rate;
|
|
diff --git a/drivers/misc/qcom/qdsp6v2/qcelp_in.c b/drivers/misc/qcom/qdsp6v2/qcelp_in.c
|
|
index b5d5ad1..aabf5d3 100644
|
|
--- a/drivers/misc/qcom/qdsp6v2/qcelp_in.c
|
|
+++ b/drivers/misc/qcom/qdsp6v2/qcelp_in.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
|
|
+/* Copyright (c) 2010-2016, 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
|
|
@@ -225,6 +225,8 @@ static long qcelp_in_compat_ioctl(struct file *file,
|
|
struct msm_audio_qcelp_enc_config32 cfg_32;
|
|
struct msm_audio_qcelp_enc_config *enc_cfg;
|
|
|
|
+ memset(&cfg_32, 0, sizeof(cfg_32));
|
|
+
|
|
enc_cfg = (struct msm_audio_qcelp_enc_config *)audio->enc_cfg;
|
|
cfg_32.cdma_rate = enc_cfg->cdma_rate;
|
|
cfg_32.min_bit_rate = enc_cfg->min_bit_rate;
|
|
--
|
|
cgit v1.1
|
|
|