diff options
author | Oliver Neukum <oliver@neukum.org> | 2009-07-28 10:52:10 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-12 11:18:28 -0400 |
commit | 085575a325de87b4931a43c9d0a75ca0d3ba5075 (patch) | |
tree | 9cc12091b7856d6cf3db50f01f4b6c5de3550c8e /drivers/media/video/stv680.c | |
parent | f5d887ae60ea1b05fcdab65e51e1ef88398ed274 (diff) |
V4L/DVB (12369): stv680: kfree called before usb_kill_urb
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.
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 'drivers/media/video/stv680.c')
-rw-r--r-- | drivers/media/video/stv680.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c index 8b4e7dafce7b..6a91714125d2 100644 --- a/drivers/media/video/stv680.c +++ b/drivers/media/video/stv680.c | |||
@@ -734,10 +734,6 @@ static int stv680_start_stream (struct usb_stv *stv680) | |||
734 | return 0; | 734 | return 0; |
735 | 735 | ||
736 | nomem_err: | 736 | nomem_err: |
737 | for (i = 0; i < STV680_NUMSCRATCH; i++) { | ||
738 | kfree(stv680->scratch[i].data); | ||
739 | stv680->scratch[i].data = NULL; | ||
740 | } | ||
741 | for (i = 0; i < STV680_NUMSBUF; i++) { | 737 | for (i = 0; i < STV680_NUMSBUF; i++) { |
742 | usb_kill_urb(stv680->urb[i]); | 738 | usb_kill_urb(stv680->urb[i]); |
743 | usb_free_urb(stv680->urb[i]); | 739 | usb_free_urb(stv680->urb[i]); |
@@ -745,6 +741,11 @@ static int stv680_start_stream (struct usb_stv *stv680) | |||
745 | kfree(stv680->sbuf[i].data); | 741 | kfree(stv680->sbuf[i].data); |
746 | stv680->sbuf[i].data = NULL; | 742 | stv680->sbuf[i].data = NULL; |
747 | } | 743 | } |
744 | /* used in irq, free only as all URBs are dead */ | ||
745 | for (i = 0; i < STV680_NUMSCRATCH; i++) { | ||
746 | kfree(stv680->scratch[i].data); | ||
747 | stv680->scratch[i].data = NULL; | ||
748 | } | ||
748 | return -ENOMEM; | 749 | return -ENOMEM; |
749 | 750 | ||
750 | } | 751 | } |