media: vivid: use vfree() instead of kfree() for dev->bitmap_cap
PATCH 1/1 media: vivid: use vfree() instead of kfree() for dev->bitmap_cap
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.
Signed-off-by Alexander Potapenko <[email protected]>
Tested-by Alexander Potapenko <[email protected]>
Reported-by [email protected]
Fixes ef834f7836ec0 ("[media] vivid: add the video capture and output
parts")
--- drivers/media/platform/vivid/vivid-vid-cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/vivid/vivid-vid-cap.c +1 -1
@@ -1007,7 +1007,7 @@ int vivid_vid_cap_s_selection(struct file *file, void *fh, struct v4l2_selectionv4l2_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;
Signature · 1 line
2.21.0.392.gf8f6787159e-goog