提交 085575a3 编写于 作者: O Oliver Neukum 提交者: Mauro Carvalho Chehab

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: NOliver Neukum <oliver@neukum.org>
Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: NDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 f5d887ae
...@@ -734,10 +734,6 @@ static int stv680_start_stream (struct usb_stv *stv680) ...@@ -734,10 +734,6 @@ static int stv680_start_stream (struct usb_stv *stv680)
return 0; return 0;
nomem_err: 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++) { for (i = 0; i < STV680_NUMSBUF; i++) {
usb_kill_urb(stv680->urb[i]); usb_kill_urb(stv680->urb[i]);
usb_free_urb(stv680->urb[i]); usb_free_urb(stv680->urb[i]);
...@@ -745,6 +741,11 @@ static int stv680_start_stream (struct usb_stv *stv680) ...@@ -745,6 +741,11 @@ static int stv680_start_stream (struct usb_stv *stv680)
kfree(stv680->sbuf[i].data); kfree(stv680->sbuf[i].data);
stv680->sbuf[i].data = NULL; 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; return -ENOMEM;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册