Commit 158d8be4 authored by Alexander Potapenko's avatar Alexander Potapenko Committed by Kleber Sacilotto de Souza

media: vivid: use vfree() instead of kfree() for dev->bitmap_cap

BugLink: https://bugs.launchpad.net/bugs/1832661

commit dad7e270 upstream.

syzkaller reported crashes on kfree() called from
vivid_vid_cap_s_selection(). This looks like a simple typo, as
dev->bitmap_cap is allocated with vzalloc() throughout the file.

Fixes: ef834f78 ("[media] vivid: add the video capture and output
parts")
Signed-off-by: default avatarAlexander Potapenko <glider@google.com>
Reported-by: default avatarSyzbot <syzbot+6c0effb5877f6b0344e2@syzkaller.appspotmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent ee2bdefd
......@@ -993,7 +993,7 @@ int vivid_vid_cap_s_selection(struct file *file, void *fh, struct v4l2_selection
rect_map_inside(&s->r, &dev->fmt_cap_rect);
if (dev->bitmap_cap && (compose->width != s->r.width ||
compose->height != s->r.height)) {
kfree(dev->bitmap_cap);
vfree(dev->bitmap_cap);
dev->bitmap_cap = NULL;
}
*compose = s->r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment