[media] gspca: only set gspca->int_urb if submitting it succeeds
authorHans de Goede <hdegoede@redhat.com>
Tue, 26 Oct 2010 08:16:32 +0000 (05:16 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 29 Dec 2010 10:16:30 +0000 (08:16 -0200)
commit2661da47daefd4f22f9fdc7e9294a1cb9edf515b
tree0a2e8731304e7637abc6bf4716ec8568a7e958ab
parent314b3e0881c6acb4f40e07565ac1a7798c7698a3
[media] gspca: only set gspca->int_urb if submitting it succeeds

Currently alloc_and_submit_int_urb() is setting gspca->int_urb
as soon as the allocation has succeeded, but if the subsequent
submit fails, the urb gets destroyed. And then later will
get destroyed again in gspca_input_destroy_urb() because
gspca->int_urb is set, leading to a double free.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gspca.c