Browse Source

Merge "dsp: codecs: fix error check for q6audio aio"

qctecmdr 5 years ago
parent
commit
3be7aef864
1 changed files with 5 additions and 1 deletions
  1. 5 1
      dsp/codecs/q6audio_v2_aio.c

+ 5 - 1
dsp/codecs/q6audio_v2_aio.c

@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
-/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/module.h>
@@ -43,6 +43,10 @@ void audio_aio_cb(uint32_t opcode, uint32_t token,
 	struct q6audio_aio *audio = (struct q6audio_aio *)priv;
 	union msm_audio_event_payload e_payload;
 
+	if (audio == NULL) {
+		pr_err("%s: failed to get q6audio value\n", __func__);
+		return;
+	}
 	switch (opcode) {
 	case ASM_DATA_EVENT_WRITE_DONE_V2:
 		pr_debug("%s[%pK]:ASM_DATA_EVENT_WRITE_DONE token = 0x%x\n",