Commit 0e21381
ASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init()
If snd_hdac_device_register() fails, 'codec' and name allocated in
dev_set_name() called in snd_hdac_device_init() are leaked. Fix this
by calling put_device(), so they can be freed in snd_hda_codec_dev_release()
and kobject_cleanup().
Fixes: e4746d9 ("ASoC: Intel: Skylake: Introduce HDA codec init and exit routines")
Signed-off-by: Yang Yingliang <[email protected]>
Suggested-by: Cezary Rojewski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>1 parent 05de5cf commit 0e21381
1 file changed
+1
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | 692 | | |
698 | 693 | | |
699 | 694 | | |
| |||
706 | 701 | | |
707 | 702 | | |
708 | 703 | | |
709 | | - | |
710 | 704 | | |
711 | 705 | | |
712 | 706 | | |
713 | 707 | | |
714 | | - | |
| 708 | + | |
715 | 709 | | |
716 | 710 | | |
717 | 711 | | |
| |||
0 commit comments