All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pádraig Brady" <P@draigBrady.com>
To: Robert Krakora <rob.krakora@messagenetsystems.com>
Cc: video4linux-list@redhat.com
Subject: Re: [PATCH 2.6.27.8 1/1] em28xx: Fix audio URB transfer buffer memory leak and race condition/corruption of capture pointer
Date: Thu, 15 Jan 2009 11:06:44 +0000	[thread overview]
Message-ID: <496F18C4.9020009@draigBrady.com> (raw)
In-Reply-To: <b24e53350901141004v6a2ed7d7nb6765fa1d112f7ef@mail.gmail.com>

Robert Krakora wrote:
> em28xx: Fix audio URB transfer buffer memory leak and race
> condition/corruption of capture pointer
> 
> 
> Signed-off-by: Robert V. Krakora <rob.krakora@messagenetsystems.com>
> 
> diff -r 6896782d783d linux/drivers/media/video/em28xx/em28xx-audio.c
> --- a/linux/drivers/media/video/em28xx/em28xx-audio.c   Wed Jan 14
> 10:06:12 2009 -0200
> +++ b/linux/drivers/media/video/em28xx/em28xx-audio.c   Wed Jan 14
> 12:47:00 2009 -0500
> @@ -62,11 +62,20 @@
>         int i;
> 
>         dprintk("Stopping isoc\n");
> -       for (i = 0; i < EM28XX_AUDIO_BUFS; i++) {
> -               usb_unlink_urb(dev->adev.urb[i]);
> -               usb_free_urb(dev->adev.urb[i]);
> -               dev->adev.urb[i] = NULL;
> -       }
> +        for (i = 0; i < EM28XX_AUDIO_BUFS; i++) {
> +               usb_unlink_urb(dev->adev.urb[i]);
> +               usb_free_urb(dev->adev.urb[i]);
> +               dev->adev.urb[i] = NULL;
> +               if (dev->adev.urb[i]) {
> +                       usb_unlink_urb(dev->adev.urb[i]);
> +                       usb_free_urb(dev->adev.urb[i]);
> +                       dev->adev.urb[i] = NULL;
> +               }
> +                if (dev->adev.transfer_buffer) {
> +                       kfree(dev->adev.transfer_buffer[i]);
> +                       dev->adev.transfer_buffer[i] = NULL;
> +               }
> +        }
> 
>         return 0;
>  }

That looks a bit incorrect. I fixed this last week in Markus'
repository, as I thought the leak was specific to that tree:
http://mcentral.de/hg/~mrec/em28xx-new/diff/1cfd9010a552/em28xx-audio.c

Pádraig.

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

  parent reply	other threads:[~2009-01-15 11:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14 18:04 [PATCH 2.6.27.8 1/1] em28xx: Fix audio URB transfer buffer memory leak and race condition/corruption of capture pointer Robert Krakora
2009-01-14 18:31 ` Robert Krakora
2009-01-14 18:44   ` Robert Krakora
2009-01-14 18:55     ` [PATCH 1/4] " Robert Krakora
2009-01-14 20:02       ` Fwd: " Robert Krakora
2009-01-14 20:08         ` Robert Krakora
2009-01-15 22:31         ` Robert Krakora
2009-01-16 14:23           ` Robert Krakora
2009-01-15 11:06 ` Pádraig Brady [this message]
2009-01-15 11:27   ` [PATCH 2.6.27.8 1/1] " Markus Rechberger
2009-01-15 14:49     ` Robert Krakora
2009-01-15 14:32   ` Robert Krakora
2009-01-15 14:58     ` Pádraig Brady
2009-01-15 15:32       ` Robert Krakora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496F18C4.9020009@draigBrady.com \
    --to=p@draigbrady.com \
    --cc=rob.krakora@messagenetsystems.com \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.