diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-15 11:59:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-15 11:59:18 -0400 |
commit | 2a5ba01ad8705048de15cd90526ecac11a2e006e (patch) | |
tree | 73ed290961f195bb020a30ca4945b10174312f65 /linux | |
parent | 8771039169bb3c0c6fc69cbbba8c20a3ab01fad9 (diff) | |
download | mediapointer-dvb-s2-2a5ba01ad8705048de15cd90526ecac11a2e006e.tar.gz mediapointer-dvb-s2-2a5ba01ad8705048de15cd90526ecac11a2e006e.tar.bz2 |
V4L: possible leak in em28xx_init_isoc
From: Florin Malita <fmalita@gmail.com>
Coverity (CID 1929) spotted the following: if a transfer buffer
allocation fails, the last allocated urb is leaked (it hasn't been
stored in dev->urb[] yet so em28xx_uninit_isoc misses it). The patch
also includes a small typo fix.
Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-core.c b/linux/drivers/media/video/em28xx/em28xx-core.c index 14291685f..f229a83da 100644 --- a/linux/drivers/media/video/em28xx/em28xx-core.c +++ b/linux/drivers/media/video/em28xx/em28xx-core.c @@ -719,7 +719,7 @@ void em28xx_uninit_isoc(struct em28xx *dev) */ int em28xx_init_isoc(struct em28xx *dev) { - /* change interface to 3 which allowes the biggest packet sizes */ + /* change interface to 3 which allows the biggest packet sizes */ int i, errCode; const int sb_size = EM28XX_NUM_PACKETS * dev->max_pkt_size; @@ -744,6 +744,7 @@ int em28xx_init_isoc(struct em28xx *dev) ("unable to allocate %i bytes for transfer buffer %i\n", sb_size, i); em28xx_uninit_isoc(dev); + usb_free_urb(urb); return -ENOMEM; } memset(dev->transfer_buffer[i], 0, sb_size); |