diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index ac97e8b7978c..8723d540ac2f 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -634,10 +634,12 @@ static int asoc_simple_probe(struct platform_device *pdev) int dai_idx = 0; + ret = -EINVAL; + cinfo = dev->platform_data; if (!cinfo) { dev_err(dev, "no info for asoc-simple-card\n"); - return -EINVAL; + goto err; } if (!cinfo->name || @@ -646,7 +648,7 @@ static int asoc_simple_probe(struct platform_device *pdev) !cinfo->platform || !cinfo->cpu_dai.name) { dev_err(dev, "insufficient asoc_simple_card_info settings\n"); - return -EINVAL; + goto err; } dai_props->cpu_dai = &priv->dais[dai_idx++];