diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-28 11:52:10 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-28 11:52:10 -0300 |
commit | 3defb5a7493d187675c33898730f3ee456530a76 (patch) | |
tree | ae1ff1b79f4ca8bb1e30221ad59e422e7176fcd9 /linux/drivers/media/video | |
parent | e0cc8a30c11596d8e20080c03a1ee6d79b5b353a (diff) | |
download | mediapointer-dvb-s2-3defb5a7493d187675c33898730f3ee456530a76.tar.gz mediapointer-dvb-s2-3defb5a7493d187675c33898730f3ee456530a76.tar.bz2 |
stv680: kfree called before usb_kill_urb
From: Oliver Neukum <oliver@neukum.org>
The irq handler will touch memory. Even in the error case some URBs may
complete. Thus no memory must be kfreed before all URBs are killed.
Priority: normal
Signed-off-by: Oliver Neukum <oliver@neukum.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/stv680.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/linux/drivers/media/video/stv680.c b/linux/drivers/media/video/stv680.c index eafe68502..600c19a78 100644 --- a/linux/drivers/media/video/stv680.c +++ b/linux/drivers/media/video/stv680.c @@ -739,10 +739,6 @@ static int stv680_start_stream (struct usb_stv *stv680) return 0; nomem_err: - for (i = 0; i < STV680_NUMSCRATCH; i++) { - kfree(stv680->scratch[i].data); - stv680->scratch[i].data = NULL; - } for (i = 0; i < STV680_NUMSBUF; i++) { usb_kill_urb(stv680->urb[i]); usb_free_urb(stv680->urb[i]); @@ -750,6 +746,11 @@ static int stv680_start_stream (struct usb_stv *stv680) kfree(stv680->sbuf[i].data); stv680->sbuf[i].data = NULL; } + /* used in irq, free only as all URBs are dead */ + for (i = 0; i < STV680_NUMSCRATCH; i++) { + kfree(stv680->scratch[i].data); + stv680->scratch[i].data = NULL; + } return -ENOMEM; } |