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

Commit 4ebda4c4 authored by Xiaojun Sang's avatar Xiaojun Sang
Browse files

misc: qcom: qdsp6v2: initialize event_wait to avoid crash



audio->event_wait is not explicitly initialized before use. It
causes potential risk of crash.

CRs-Fixed: 1031531
Change-Id: I92e09c1ed096fb86df782a8537b3ea4ea9be250b
Signed-off-by: default avatarXiaojun Sang <xsang@codeaurora.org>
parent e4aa3259
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 *
 *
 * Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 HTC Corporation
 * Copyright (C) 2008 HTC Corporation
 * Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
 *
 *
 * This software is licensed under the terms of the GNU General Public
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * License version 2, as published by the Free Software Foundation, and
@@ -376,6 +376,8 @@ static int audio_open(struct inode *inode, struct file *file)
	audio->audio_ws_mgr = &audio_aac_ws_mgr;
	audio->audio_ws_mgr = &audio_aac_ws_mgr;
	aac_config->dual_mono_mode = AUDIO_AAC_DUAL_MONO_INVALID;
	aac_config->dual_mono_mode = AUDIO_AAC_DUAL_MONO_INVALID;


	init_waitqueue_head(&audio->event_wait);

	audio->ac = q6asm_audio_client_alloc((app_cb) q6_audio_cb,
	audio->ac = q6asm_audio_client_alloc((app_cb) q6_audio_cb,
					     (void *)audio);
					     (void *)audio);


+3 −1
Original line number Original line Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
*
*
* This program is free software; you can redistribute it and/or modify
* 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
* it under the terms of the GNU General Public License version 2 and
@@ -288,6 +288,8 @@ static int audio_open(struct inode *inode, struct file *file)
	audio->wakelock_voted = false;
	audio->wakelock_voted = false;
	audio->audio_ws_mgr = &audio_alac_ws_mgr;
	audio->audio_ws_mgr = &audio_alac_ws_mgr;


	init_waitqueue_head(&audio->event_wait);

	audio->ac = q6asm_audio_client_alloc((app_cb) q6_audio_cb,
	audio->ac = q6asm_audio_client_alloc((app_cb) q6_audio_cb,
					     (void *)audio);
					     (void *)audio);


+3 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 *
 *
 * Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 HTC Corporation
 * Copyright (C) 2008 HTC Corporation
 * Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
 *
 *
 * This software is licensed under the terms of the GNU General Public
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * License version 2, as published by the Free Software Foundation, and
@@ -89,6 +89,8 @@ static int audio_open(struct inode *inode, struct file *file)
	audio->wakelock_voted = false;
	audio->wakelock_voted = false;
	audio->audio_ws_mgr = &audio_amrnb_ws_mgr;
	audio->audio_ws_mgr = &audio_amrnb_ws_mgr;


	init_waitqueue_head(&audio->event_wait);

	audio->ac = q6asm_audio_client_alloc((app_cb) q6_audio_cb,
	audio->ac = q6asm_audio_client_alloc((app_cb) q6_audio_cb,
					     (void *)audio);
					     (void *)audio);


+3 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 *
 *
 * Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 HTC Corporation
 * Copyright (C) 2008 HTC Corporation
 * Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
 *
 *
 * This software is licensed under the terms of the GNU General Public
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * License version 2, as published by the Free Software Foundation, and
@@ -91,6 +91,8 @@ static int audio_open(struct inode *inode, struct file *file)
	audio->wakelock_voted = false;
	audio->wakelock_voted = false;
	audio->audio_ws_mgr = &audio_amrwb_ws_mgr;
	audio->audio_ws_mgr = &audio_amrwb_ws_mgr;


	init_waitqueue_head(&audio->event_wait);

	audio->ac = q6asm_audio_client_alloc((app_cb) q6_audio_cb,
	audio->ac = q6asm_audio_client_alloc((app_cb) q6_audio_cb,
					     (void *)audio);
					     (void *)audio);


+3 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 *
 *
 * Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 Google, Inc.
 * Copyright (C) 2008 HTC Corporation
 * Copyright (C) 2008 HTC Corporation
 * Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
 *
 *
 * This software is licensed under the terms of the GNU General Public
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * License version 2, as published by the Free Software Foundation, and
@@ -309,6 +309,8 @@ static int audio_open(struct inode *inode, struct file *file)
	audio->wakelock_voted = false;
	audio->wakelock_voted = false;
	audio->audio_ws_mgr = &audio_amrwbplus_ws_mgr;
	audio->audio_ws_mgr = &audio_amrwbplus_ws_mgr;


	init_waitqueue_head(&audio->event_wait);

	audio->ac =
	audio->ac =
	q6asm_audio_client_alloc((app_cb) q6_audio_cb, (void *)audio);
	q6asm_audio_client_alloc((app_cb) q6_audio_cb, (void *)audio);


Loading