Skip to content

Commit

Permalink
ASoC: fsl: Fix error handling if platform_device_add fails
Browse files Browse the repository at this point in the history
Call platform_device_put() instead of platform_device_unregister() if
platform_device_add() fails.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Sep 20, 2011
1 parent ded71dc commit d890a1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sound/soc/fsl/mpc8610_hpcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
return 0;

error_sound:
platform_device_unregister(sound_device);
platform_device_put(sound_device);
error:
kfree(machine_data);
error_alloc:
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/fsl/p1022_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static int p1022_ds_probe(struct platform_device *pdev)

error:
if (sound_device)
platform_device_unregister(sound_device);
platform_device_put(sound_device);

kfree(mdata);
error_put:
Expand Down

0 comments on commit d890a1a

Please sign in to comment.