All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: vivid: use vfree() instead of kfree() for dev->bitmap_cap
@ 2019-04-04 14:56 Alexander Potapenko
  0 siblings, 0 replies; only message in thread
From: Alexander Potapenko @ 2019-04-04 14:56 UTC (permalink / raw)
  To: hverkuil, mchehab; +Cc: linux-media, linux-kernel, syzkaller-bugs

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 <glider@google.com>
Tested-by: Alexander Potapenko <glider@google.com>
Reported-by: syzbot+6c0effb5877f6b0344e2@syzkaller.appspotmail.com
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(-)

diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c
index 52eeda624d7e..530ac8decb25 100644
--- a/drivers/media/platform/vivid/vivid-vid-cap.c
+++ b/drivers/media/platform/vivid/vivid-vid-cap.c
@@ -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;
-- 
2.21.0.392.gf8f6787159e-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-04 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 14:56 [PATCH] media: vivid: use vfree() instead of kfree() for dev->bitmap_cap Alexander Potapenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.