Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3baefa3a authored by Laxminath Kasam's avatar Laxminath Kasam
Browse files

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: default avatarLaxminath Kasam <lkasam@codeaurora.org>
parent 545901ee
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * 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) {
+3 −1
Original line number Diff line number Diff line
/* 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;
+2 −0
Original line number Diff line number Diff line
@@ -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;
+2 −0
Original line number Diff line number Diff line
@@ -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 =
+4 −0
Original line number Diff line number Diff line
@@ -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;
Loading