Skip to content

Commit

Permalink
V4L/DVB (9586): Fix possible null pointer dereference in info message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent a527c9f commit 4924044
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,8 +1600,6 @@ static void em28xx_release_resources(struct em28xx *dev)

/*FIXME: I2C IR should be disconnected */

em28xx_info("V4L2 devices /dev/video%d and /dev/vbi%d deregistered\n",
dev->vdev->num, dev->vbi_dev->num);
list_del(&dev->devlist);
if (dev->sbutton_input_dev)
em28xx_deregister_snapshot_button(dev);
Expand All @@ -1613,13 +1611,17 @@ static void em28xx_release_resources(struct em28xx *dev)
dev->radio_dev = NULL;
}
if (dev->vbi_dev) {
em28xx_info("V4L2 device /dev/vbi%d deregistered\n",
dev->vbi_dev->num);
if (-1 != dev->vbi_dev->minor)
video_unregister_device(dev->vbi_dev);
else
video_device_release(dev->vbi_dev);
dev->vbi_dev = NULL;
}
if (dev->vdev) {
em28xx_info("V4L2 device /dev/video%d deregistered\n",
dev->vdev->num);
if (-1 != dev->vdev->minor)
video_unregister_device(dev->vdev);
else
Expand Down

0 comments on commit 4924044

Please sign in to comment.