Skip to content

Commit

Permalink
media: vivid: use vfree() instead of kfree() for dev->bitmap_cap
Browse files Browse the repository at this point in the history
commit dad7e27 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: ef834f7 ("[media] vivid: add the video capture and output
parts")

Signed-off-by: Alexander Potapenko <glider@google.com>
Reported-by: Syzbot <syzbot+6c0effb5877f6b0344e2@syzkaller.appspotmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
ramosian-glider authored and gregkh committed May 31, 2019
1 parent f1c9f1f commit cbe3210
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/platform/vivid/vivid-vid-cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ int vivid_vid_cap_s_selection(struct file *file, void *fh, struct v4l2_selection
v4l2_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;
Expand Down

0 comments on commit cbe3210

Please sign in to comment.