Skip to content

Commit ae2cb00

Browse files
Wenping Zhangrkhuangtao
authored andcommitted
ASoC: soc-generic-dmaengine-pcm: fix kernel panic caused by no dma channel.
if there is no dma channel for sound, it will cause kernel panic. CallTrace: [ 3.051899] Unable to handle kernel NULL pointer dereference at virtual address 00000268 [ 3.056756] PC is at dmaengine_pcm_new+0x94/0x268 [ 3.057189] LR is at soc_new_pcm+0x394/0x42c [ 3.225565] [<ffffff80088c8b80>] dmaengine_pcm_new+0x94/0x268 [ 3.226083] [<ffffff80088c6cf0>] soc_new_pcm+0x394/0x42c [ 3.226568] [<ffffff80088bb6bc>] snd_soc_register_card+0x9cc/0xe78 [ 3.227124] [<ffffff80088c733c>] devm_snd_soc_register_card+0x4c/0x88 [ 3.227704] [<ffffff80088d4848>] asoc_simple_card_probe+0x3c8/0x3f8 [ 3.228274] [<ffffff80084f811c>] platform_drv_probe+0x58/0xa4 [ 3.228791] [<ffffff80084f638c>] driver_probe_device+0x118/0x2ac [ 3.229333] [<ffffff80084f666c>] __device_attach_driver+0x88/0x98 [ 3.229886] [<ffffff80084f479c>] bus_for_each_drv+0x7c/0xac [ 3.230391] [<ffffff80084f61c0>] __device_attach+0xa4/0x124 [ 3.230896] [<ffffff80084f67d8>] device_initial_probe+0x10/0x18 [ 3.231425] [<ffffff80084f5820>] bus_probe_device+0x2c/0x8c [ 3.231930] [<ffffff80084f5c94>] deferred_probe_work_func+0x74/0xa0 [ 3.232500] [<ffffff80080bac00>] process_one_work+0x228/0x3f4 [ 3.233018] [<ffffff80080bb618>] worker_thread+0x304/0x418 [ 3.233512] [<ffffff80080bff84>] kthread+0xe8/0xf0 [ 3.233944] [<ffffff80080832a0>] ret_from_fork+0x10/0x30 Fixes: 57fae85 ("ASoC: rockchip: add support for "rockchip,force-iram"") Change-Id: Ia225ec129d04690fe64a61f15ad6152a71927d27 Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
1 parent 5a6b1b8 commit ae2cb00

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/soc-generic-dmaengine-pcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
278278
return 0;
279279

280280
dev = dmaengine_dma_dev(pcm, substream);
281-
if (dev->of_node) {
281+
if (dev && dev->of_node) {
282282
ret = of_property_read_bool(dev->of_node,
283283
"rockchip,force-iram");
284284
if (ret)

0 commit comments

Comments
 (0)