diff options
author | Devin Heitmueller <devin.heitmueller@gmail.com> | 2008-11-12 00:05:15 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:32 -0500 |
commit | 492404449532e40b5b6ed06b56aae2bf710239e6 (patch) | |
tree | a81b4f95bf373809bacbb6aad3e7d034dd9ef651 /drivers/media/video/em28xx/em28xx-video.c | |
parent | a527c9f827517a14b869511a954910d973556c8c (diff) |
V4L/DVB (9586): Fix possible null pointer dereference in info message
Fix case where we could end up dereferencing a NULL pointer if dev->vdev or
dev->vbi_dev were not set properly.
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 415dff830f88..e8edeecf367d 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1600,8 +1600,6 @@ static void em28xx_release_resources(struct em28xx *dev) | |||
1600 | 1600 | ||
1601 | /*FIXME: I2C IR should be disconnected */ | 1601 | /*FIXME: I2C IR should be disconnected */ |
1602 | 1602 | ||
1603 | em28xx_info("V4L2 devices /dev/video%d and /dev/vbi%d deregistered\n", | ||
1604 | dev->vdev->num, dev->vbi_dev->num); | ||
1605 | list_del(&dev->devlist); | 1603 | list_del(&dev->devlist); |
1606 | if (dev->sbutton_input_dev) | 1604 | if (dev->sbutton_input_dev) |
1607 | em28xx_deregister_snapshot_button(dev); | 1605 | em28xx_deregister_snapshot_button(dev); |
@@ -1613,6 +1611,8 @@ static void em28xx_release_resources(struct em28xx *dev) | |||
1613 | dev->radio_dev = NULL; | 1611 | dev->radio_dev = NULL; |
1614 | } | 1612 | } |
1615 | if (dev->vbi_dev) { | 1613 | if (dev->vbi_dev) { |
1614 | em28xx_info("V4L2 device /dev/vbi%d deregistered\n", | ||
1615 | dev->vbi_dev->num); | ||
1616 | if (-1 != dev->vbi_dev->minor) | 1616 | if (-1 != dev->vbi_dev->minor) |
1617 | video_unregister_device(dev->vbi_dev); | 1617 | video_unregister_device(dev->vbi_dev); |
1618 | else | 1618 | else |
@@ -1620,6 +1620,8 @@ static void em28xx_release_resources(struct em28xx *dev) | |||
1620 | dev->vbi_dev = NULL; | 1620 | dev->vbi_dev = NULL; |
1621 | } | 1621 | } |
1622 | if (dev->vdev) { | 1622 | if (dev->vdev) { |
1623 | em28xx_info("V4L2 device /dev/video%d deregistered\n", | ||
1624 | dev->vdev->num); | ||
1623 | if (-1 != dev->vdev->minor) | 1625 | if (-1 != dev->vdev->minor) |
1624 | video_unregister_device(dev->vdev); | 1626 | video_unregister_device(dev->vdev); |
1625 | else | 1627 | else |