ASoC: simple-card: fix a bug where cinfo will be NULL before using it
PATCH 1/1 ASoC: simple-card: fix a bug where cinfo will be NULL before using it
If the dt is not used, the cinfo will be always NULL before using it.
Signed-off-by Xiubo Li <[email protected]>
--- sound/soc/generic/simple-card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/generic/simple-card.c +1 -1
@@ -225,8 +225,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev) } } }else { - cinfo->snd_card.dev = &pdev->dev; cinfo = pdev->dev.platform_data; + cinfo->snd_card.dev = &pdev->dev; }if (!cinfo) {
Signature · 1 line
1.8.4
Mark Brown
maintainersound/soc/generic/simple-card.c static int asoc_simple_card_probe(struct platform_device *pdev) · line 230
Quoted 5 lines · Xiubo Li
sound/soc/generic/simple-card.c +1
-1}else { - cinfo->snd_card.dev = &pdev->dev; cinfo = pdev->dev.platform_data; + cinfo->snd_card.dev = &pdev->dev; }
I've applied this since not crashing is good but it's a bug to be writing to the platform data at all, it should be constant. If it needs to be written to a copy should be being used.