Message ID | 20180803170153.2FC2C1123AA1@debutante.sirena.org.uk |
---|---|
State | New |
Headers | show |
Series | Applied "ASoC: smd845: fix memory leak" to the asoc tree | expand |
diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c index be0cb1122036..c1adb77230eb 100644 --- a/sound/soc/qcom/sdm845.c +++ b/sound/soc/qcom/sdm845.c @@ -222,8 +222,10 @@ static int sdm845_snd_platform_probe(struct platform_device *pdev) /* Allocate the private data */ data = kzalloc(sizeof(*data), GFP_KERNEL); - if (!data) - return -ENOMEM; + if (!data) { + ret = -ENOMEM; + goto data_alloc_fail; + } card->dev = dev; dev_set_drvdata(dev, card); @@ -248,6 +250,7 @@ static int sdm845_snd_platform_probe(struct platform_device *pdev) kfree(card->dai_link); parse_dt_fail: kfree(data); +data_alloc_fail: kfree(card); return ret; }