summaryrefslogtreecommitdiff
path: root/sound/soc/fsl
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/p1022_ds.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c
index f8176e8e1adf..63b9eaa1ebc2 100644
--- a/sound/soc/fsl/p1022_ds.c
+++ b/sound/soc/fsl/p1022_ds.c
@@ -346,8 +346,10 @@ static int p1022_ds_probe(struct platform_device *pdev)
}
mdata = kzalloc(sizeof(struct machine_data), GFP_KERNEL);
- if (!mdata)
- return -ENOMEM;
+ if (!mdata) {
+ ret = -ENOMEM;
+ goto error_put;
+ }
mdata->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev);
mdata->dai[0].ops = &p1022_ds_ops;
@@ -502,13 +504,12 @@ static int p1022_ds_probe(struct platform_device *pdev)
return 0;
error:
- of_node_put(codec_np);
-
if (sound_device)
platform_device_unregister(sound_device);
kfree(mdata);
-
+error_put:
+ of_node_put(codec_np);
return ret;
}