From 93ebae336cccb31fe4e1c3dfe2f2bef287f5e667 Mon Sep 17 00:00:00 2001 From: Shunhua Lan Date: Sat, 2 Mar 2024 15:02:18 +0800 Subject: [PATCH] ASoC: rockchip: dlp: Add NULL pointer check for substream in substream_to_drd Hardware name: Rockchip RK3576 V10 Board (DT) pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : dlp_start+0x5c/0x284 lr : dmaengine_mpcm_trigger+0x404/0x40c sp : ffffffc00dfd3a60 x29: ffffffc00dfd3a90 x28: 0000000000000000 x27: 0000000000000004 x26: 0000000000000002 x25: ffffff80200a16c0 x24: 0000000000000000 x23: ffffff80c1986588 x22: ffffff80d2a4e800 x21: ffffffc00905f1a0 x20: ffffff80c24cc410 x19: ffffff80c2df9bc0 x18: ffffffc00c8dd088 x17: 0000000000000001 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: ffffffc00aa98d08 x12: 0000000000000000 x11: ffffffc00aa98d0c x10: 00000000000003c8 x9 : ffffff80940593c8 x8 : ffffff80f9f96000 x7 : 0000000000000000 x6 : 0000000000000002 x5 : 0000000000000001 x4 : 0000000000000000 x3 : ffffffc00905f1a0 x2 : ffffff80c24cc410 x1 : ffffff80d2a4e800 x0 : ffffff80c2df9bc0 Call trace: dlp_start+0x5c/0x284 dmaengine_mpcm_trigger+0x404/0x40c snd_soc_pcm_component_trigger+0x8c/0x1c8 soc_pcm_trigger+0x70/0x198 snd_pcm_do_start+0x34/0x40 snd_pcm_action+0x90/0x148 snd_pcm_start+0x20/0x2c __snd_pcm_lib_xfer+0x664/0x750 snd_pcm_xferi_frames_ioctl+0x1ec/0x3b4 snd_pcm_common_ioctl+0x384/0x608 snd_pcm_ioctl+0x30/0x48 __arm64_sys_ioctl+0x90/0xc8 invoke_syscall+0x40/0x104 el0_svc_common+0xbc/0x168 do_el0_svc+0x1c/0x28 el0_svc+0x1c/0x68 el0t_64_sync_handler+0x68/0xb4 el0t_64_sync+0x164/0x168 Signed-off-by: Shunhua Lan Signed-off-by: Sugar Zhang Change-Id: Iff8c5c79bb42901a7fa50a49e2328a545c2a9b3c --- sound/soc/rockchip/rockchip_dlp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_dlp.h b/sound/soc/rockchip/rockchip_dlp.h index e3c6d24e6503..cefd7a4e498d 100644 --- a/sound/soc/rockchip/rockchip_dlp.h +++ b/sound/soc/rockchip/rockchip_dlp.h @@ -81,7 +81,7 @@ static inline struct dlp *soc_component_to_dlp(struct snd_soc_component *p) static inline struct dlp_runtime_data *substream_to_drd( const struct snd_pcm_substream *substream) { - if (!substream->runtime) + if (!substream || !substream->runtime) return NULL; return substream->runtime->private_data;