Repository navigation
Commit 22be5a1
media: em28xx: fix memory leak in em28xx_init_dev
In the em28xx_init_rev, if em28xx_audio_setup fails, this function fails
to deallocate the media_dev allocated in the em28xx_media_device_init.
Fix this by adding em28xx_unregister_media_device to free media_dev.
BTW, this patch is tested in my local syzkaller instance, and it can
prevent the memory leak from occurring again.
CC: Pavel Skripkin <paskripkin@gmail.com>
Fixes: 37ecc7b ("[media] em28xx: add media controller support")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Reported-by: syzkaller <syzkaller@googlegroups.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>1 parent 91bd11a commit 22be5a1
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3630 | 3630 | | |
3631 | 3631 | | |
3632 | 3632 | | |
3633 | | - | |
3634 | | - | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
3635 | 3637 | | |
3636 | 3638 | | |
3637 | 3639 | | |
| |||
3650 | 3652 | | |
3651 | 3653 | | |
3652 | 3654 | | |
3653 | | - | |
| 3655 | + | |
3654 | 3656 | | |
3655 | 3657 | | |
3656 | 3658 | | |
| |||
3666 | 3668 | | |
3667 | 3669 | | |
3668 | 3670 | | |
3669 | | - | |
3670 | | - | |
3671 | | - | |
| 3671 | + | |
3672 | 3672 | | |
3673 | 3673 | | |
3674 | 3674 | | |
3675 | 3675 | | |
3676 | 3676 | | |
3677 | 3677 | | |
3678 | 3678 | | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
3679 | 3685 | | |
3680 | 3686 | | |
3681 | 3687 | | |
| |||
0 commit comments