diff options
author | Ricardo Neri <ricardo.neri@ti.com> | 2012-10-15 13:10:36 -0500 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2012-11-27 11:42:48 +0800 |
commit | 892299208cf4b823c5c0ab2c0b703934ef882cc5 (patch) | |
tree | e47afcff5ba6748b7a0571a495a659a996d51251 | |
parent | 1cbe574f200b55de4af5b77b0b8dbeedb1e79bd8 (diff) |
ASoC: OMAP: HDMI: Check if the codec pdev is valid before unregister
Errors when registering the card may occur in DT and non-DT boots. We create
the audio codec platform device from here only in DT boots. Thus, if card
registration fails in non-DT, we would be unregistering an invalid codec
platform device.
Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
-rw-r--r-- | sound/soc/omap/omap-hdmi-card.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/omap/omap-hdmi-card.c b/sound/soc/omap/omap-hdmi-card.c index b1cf892a2cd..c7695c9eee5 100644 --- a/sound/soc/omap/omap-hdmi-card.c +++ b/sound/soc/omap/omap-hdmi-card.c @@ -107,7 +107,8 @@ static __devinit int omap_hdmi_probe(struct platform_device *pdev) return 0; err_register_card: - platform_device_unregister(card_data->codec_pdev); + if (!IS_ERR(card_data->codec_pdev)) + platform_device_unregister(card_data->codec_pdev); return ret; } |