提交 c1a16414 编写于 作者: M Mauro Carvalho Chehab

V4L/DVB (12805): tm6000: Fix a memory leak at tm6000-video

if a transfer buffer allocation fails, the last allocated urb is leaked
(it hasn't been stored in dev->urb[] yet so tm6000_uninit_isoc misses
it). The patch also includes a small typo fix.

Thanks to Florin Malita <fmalita@gmail.com> for pointing this.
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 2b971af2
...@@ -672,6 +672,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev, ...@@ -672,6 +672,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev,
if (!urb) { if (!urb) {
tm6000_err("cannot alloc isoc_ctl.urb %i\n", i); tm6000_err("cannot alloc isoc_ctl.urb %i\n", i);
tm6000_uninit_isoc(dev); tm6000_uninit_isoc(dev);
usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
} }
dev->isoc_ctl.urb[i] = urb; dev->isoc_ctl.urb[i] = urb;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册