Web lists-archives.org

Re: Copy and paste error in em28xx_init_isoc




On Thursday 24 April 2008 20:58:21 Mauro Carvalho Chehab wrote:
> >
> > attached patch fixes a copy and paste error in check of kzalloc
> > return value. The check block was copied from the previous
> > allocation but the variable wasn't exchanged.
>
> Thanks for the patch.

you're welcome.

> >  		em28xx_errdev("cannot allocate memory for usbtransfer\n");
> > -		kfree(dev->isoc_ctl.urb);
> > +		kfree(dev->isoc_ctl.transfer_buffer);
>
> This, however, were right. isoc_ctl.urb is allocated, and should be
> freed. However, transfer_buffer is NULL, so it doesn't need kfree.

Yes, I was clearly not thinking.

> Could you please re-generate the patch and send me again?

sure, attached and

Signed-of-by: "Janne Grunau <janne-dvb@xxxxxxxxx>"

Janne
diff -r f13d66bbe1df linux/drivers/media/video/em28xx/em28xx-core.c
--- a/linux/drivers/media/video/em28xx/em28xx-core.c	Thu Apr 24 20:56:14 2008 +0200
+++ b/linux/drivers/media/video/em28xx/em28xx-core.c	Thu Apr 24 21:34:24 2008 +0200
@@ -659,7 +659,7 @@ int em28xx_init_isoc(struct em28xx *dev,
 
 	dev->isoc_ctl.transfer_buffer = kzalloc(sizeof(void *)*num_bufs,
 					      GFP_KERNEL);
-	if (!dev->isoc_ctl.urb) {
+	if (!dev->isoc_ctl.transfer_buffer) {
 		em28xx_errdev("cannot allocate memory for usbtransfer\n");
 		kfree(dev->isoc_ctl.urb);
 		return -ENOMEM;
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list