mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
ALSA: ac97: Fix double free of ac97_codec_device
commit607975b30d
upstream. put_device will call ac97_codec_release to free ac97_codec_device and other resources, so remove the kfree and other redundant code. Fixes:74426fbff6
("ALSA: ac97: add an ac97 bus") Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9845fb5a3f
commit
602744097b
1 changed files with 4 additions and 9 deletions
|
@ -125,17 +125,12 @@ static int ac97_codec_add(struct ac97_controller *ac97_ctrl, int idx,
|
|||
vendor_id);
|
||||
|
||||
ret = device_add(&codec->dev);
|
||||
if (ret)
|
||||
goto err_free_codec;
|
||||
if (ret) {
|
||||
put_device(&codec->dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
err_free_codec:
|
||||
of_node_put(codec->dev.of_node);
|
||||
put_device(&codec->dev);
|
||||
kfree(codec);
|
||||
ac97_ctrl->codecs[idx] = NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned int snd_ac97_bus_scan_one(struct ac97_controller *adrv,
|
||||
|
|
Loading…
Reference in a new issue