Patch: USBVision - Replacement of vmalloc_32 with vmalloc_32_user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch replaces vmalloc_32 with vmalloc_32_user.  Allocating virtually contiguous memory (32bit addressable) which is zeroed so it can be mapped to userspace without leaking data.


Signed-off-by: Dwaine P. Garden <DwaineGarden@xxxxxxxxxx>


diff -U 3 -H -d -r -N -- a/linux/drivers/media/video/usbvision/usbvision-core.c b/linux/drivers/media/video/usbvision/usbvision-core.c
--- a/linux/drivers/media/video/usbvision/usbvision-core.c	2007-01-15 19:11:11.000000000 -0500
+++ b/linux/drivers/media/video/usbvision/usbvision-core.c	2007-01-15 20:32:06.000000000 -0500
@@ -131,7 +131,7 @@
 	unsigned long adr;
 
 	size = PAGE_ALIGN(size);
-	mem = vmalloc_32(size);
+	mem = vmalloc_32_user(size);
 	if (!mem)
 		return NULL;
 
@@ -414,7 +414,7 @@
 
 int usbvision_scratch_alloc(struct usb_usbvision *usbvision)
 {
-	usbvision->scratch = vmalloc_32(scratch_buf_size);
+	usbvision->scratch = vmalloc_32_user(scratch_buf_size);
 	scratch_reset(usbvision);
 	if(usbvision->scratch == NULL) {
 		err("%s: unable to allocate %d bytes for scratch",
@@ -525,7 +525,7 @@
 int usbvision_decompress_alloc(struct usb_usbvision *usbvision)
 {
 	int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2;
-	usbvision->IntraFrameBuffer = vmalloc_32(IFB_size);
+	usbvision->IntraFrameBuffer = vmalloc_32_user(IFB_size);
 	if (usbvision->IntraFrameBuffer == NULL) {
 		err("%s: unable to allocate %d for compr. frame buffer", __FUNCTION__, IFB_size);
 		return -ENOMEM;
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux