diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-04-11 17:19:33 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-05-12 18:54:59 -0400 |
commit | 7c908fbb0139fa1080412d0590189abfe2df87eb (patch) | |
tree | 2cec8f26118a835e47f5c37d399b4384a96478d9 /drivers/media | |
parent | b37492be25be5ff0551bff8b479e783498ebe838 (diff) |
V4L/DVB (3790): Use after free in drivers/media/video/em28xx/em28xx-video.c
In several places we use dev->devno right after we kfree() dev. This fixes
coverity bug id #1065
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index ddc92cbb5276..cf7cdf9ef617 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1576,8 +1576,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1576 | errCode = em28xx_config(dev); | 1576 | errCode = em28xx_config(dev); |
1577 | if (errCode) { | 1577 | if (errCode) { |
1578 | em28xx_errdev("error configuring device\n"); | 1578 | em28xx_errdev("error configuring device\n"); |
1579 | kfree(dev); | ||
1580 | em28xx_devused&=~(1<<dev->devno); | 1579 | em28xx_devused&=~(1<<dev->devno); |
1580 | kfree(dev); | ||
1581 | return -ENOMEM; | 1581 | return -ENOMEM; |
1582 | } | 1582 | } |
1583 | 1583 | ||
@@ -1603,8 +1603,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1603 | dev->vdev = video_device_alloc(); | 1603 | dev->vdev = video_device_alloc(); |
1604 | if (NULL == dev->vdev) { | 1604 | if (NULL == dev->vdev) { |
1605 | em28xx_errdev("cannot allocate video_device.\n"); | 1605 | em28xx_errdev("cannot allocate video_device.\n"); |
1606 | kfree(dev); | ||
1607 | em28xx_devused&=~(1<<dev->devno); | 1606 | em28xx_devused&=~(1<<dev->devno); |
1607 | kfree(dev); | ||
1608 | return -ENOMEM; | 1608 | return -ENOMEM; |
1609 | } | 1609 | } |
1610 | 1610 | ||
@@ -1612,8 +1612,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1612 | if (NULL == dev->vbi_dev) { | 1612 | if (NULL == dev->vbi_dev) { |
1613 | em28xx_errdev("cannot allocate video_device.\n"); | 1613 | em28xx_errdev("cannot allocate video_device.\n"); |
1614 | kfree(dev->vdev); | 1614 | kfree(dev->vdev); |
1615 | kfree(dev); | ||
1616 | em28xx_devused&=~(1<<dev->devno); | 1615 | em28xx_devused&=~(1<<dev->devno); |
1616 | kfree(dev); | ||
1617 | return -ENOMEM; | 1617 | return -ENOMEM; |
1618 | } | 1618 | } |
1619 | 1619 | ||
@@ -1650,8 +1650,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1650 | mutex_unlock(&dev->lock); | 1650 | mutex_unlock(&dev->lock); |
1651 | list_del(&dev->devlist); | 1651 | list_del(&dev->devlist); |
1652 | video_device_release(dev->vdev); | 1652 | video_device_release(dev->vdev); |
1653 | kfree(dev); | ||
1654 | em28xx_devused&=~(1<<dev->devno); | 1653 | em28xx_devused&=~(1<<dev->devno); |
1654 | kfree(dev); | ||
1655 | return -ENODEV; | 1655 | return -ENODEV; |
1656 | } | 1656 | } |
1657 | 1657 | ||
@@ -1662,8 +1662,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1662 | list_del(&dev->devlist); | 1662 | list_del(&dev->devlist); |
1663 | video_device_release(dev->vbi_dev); | 1663 | video_device_release(dev->vbi_dev); |
1664 | video_device_release(dev->vdev); | 1664 | video_device_release(dev->vdev); |
1665 | kfree(dev); | ||
1666 | em28xx_devused&=~(1<<dev->devno); | 1665 | em28xx_devused&=~(1<<dev->devno); |
1666 | kfree(dev); | ||
1667 | return -ENODEV; | 1667 | return -ENODEV; |
1668 | } else { | 1668 | } else { |
1669 | printk("registered VBI\n"); | 1669 | printk("registered VBI\n"); |