Skip to contentSkip to conversation

videobuf-dma-contig: fix USERPTR free handling

PATCH In review Magnus Damm 3 participants 4 messages Dec 10, 2008 – Jan 24, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 videobuf-dma-contig: fix USERPTR free handling

From: Magnus Damm <[email protected]>

This patch fixes a free-without-alloc bug for V4L2_MEMORY_USERPTR video buffers.

---

 drivers/media/video/videobuf-dma-contig.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/video/videobuf-dma-contig.c +1 -1
@@ -400,7 +400,7 @@ void videobuf_dma_contig_free(struct vid
 	   So, it should free memory only if the memory were allocated for
 	   read() operation.
 	 */
-	if ((buf->memory != V4L2_MEMORY_USERPTR) || !buf->baddr)
+	if ((buf->memory != V4L2_MEMORY_USERPTR) || buf->baddr)
 		return;
 
 	if (!mem)

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#1 lore raw
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

This patch fixes a free-without-alloc bug for V4L2_MEMORY_USERPTR video buffers.

Mauro, what about this patch? Is it correct? If so, it shall be applied I presume, as in that case it is a bug-fix.

Thanks
Guennadi

Quoted 9 lines

---

 drivers/media/video/videobuf-dma-contig.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

drivers/media/video/videobuf-dma-contig.c void videobuf_dma_contig_free(struct vid · line 406

Quoted 8 lines
drivers/media/video/videobuf-dma-contig.c +1 -1
@@ -400,7 +400,7 @@ void videobuf_dma_contig_free(struct vid
 	   So, it should free memory only if the memory were allocated for
 	   read() operation.
 	 */
-	if ((buf->memory != V4L2_MEMORY_USERPTR) || !buf->baddr)
+	if ((buf->memory != V4L2_MEMORY_USERPTR) || buf->baddr)
 		return;
 
 	if (!mem)

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#2 lore raw
Quoted 11 lines · Guennadi Liakhovetski
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

This patch fixes a free-without-alloc bug for V4L2_MEMORY_USERPTR video buffers.

Mauro, what about this patch? Is it correct? If so, it shall be applied I presume, as in that case it is a bug-fix.

It's a bug fix and getting it included would be great!

Thank you.

/ magnus

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#3 lore raw
Quoted 9 lines · On Fri, 16 Jan 2009 13:57:27 +0900 "Magnus Damm" <[email protected]> wrote:
Quoted 7 lines · Guennadi Liakhovetski
Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

This patch fixes a free-without-alloc bug for V4L2_MEMORY_USERPTR video buffers.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Mauro, what about this patch? Is it correct? If so, it shall be applied I presume, as in that case it is a bug-fix.

It's a bug fix and getting it included would be great!

The patch is ok. I've just committed it. I should be adding on my next upstream pull request.

Cheers,
Mauro

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list