summaryrefslogtreecommitdiffstats
path: root/sound/ac97/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/ac97/bus.c')
-rw-r--r--sound/ac97/bus.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c
index 7b977b753a03..7985dd8198b6 100644
--- a/sound/ac97/bus.c
+++ b/sound/ac97/bus.c
@@ -122,17 +122,12 @@ static int ac97_codec_add(struct ac97_controller *ac97_ctrl, int idx,
122 vendor_id); 122 vendor_id);
123 123
124 ret = device_add(&codec->dev); 124 ret = device_add(&codec->dev);
125 if (ret) 125 if (ret) {
126 goto err_free_codec; 126 put_device(&codec->dev);
127 return ret;
128 }
127 129
128 return 0; 130 return 0;
129err_free_codec:
130 of_node_put(codec->dev.of_node);
131 put_device(&codec->dev);
132 kfree(codec);
133 ac97_ctrl->codecs[idx] = NULL;
134
135 return ret;
136} 131}
137 132
138unsigned int snd_ac97_bus_scan_one(struct ac97_controller *adrv, 133unsigned int snd_ac97_bus_scan_one(struct ac97_controller *adrv,