summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/videodev.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c
index 5bc4e34dc..b13bbfe61 100644
--- a/linux/drivers/media/video/videodev.c
+++ b/linux/drivers/media/video/videodev.c
@@ -1532,6 +1532,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
int i=0;
int base;
int end;
+ int ret;
char *name_base;
switch(type)
@@ -1597,7 +1598,13 @@ int video_register_device(struct video_device *vfd, int type, int nr)
vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
#endif
strlcpy(vfd->class_dev.class_id, vfd->devfs_name + 4, BUS_ID_SIZE);
- class_device_register(&vfd->class_dev);
+ ret = class_device_register(&vfd->class_dev);
+ if (ret) {
+ printk(KERN_ERR "%s: class_device_register failed\n",
+ __FUNCTION__);
+ kfree(&vfd->class_dev);
+ return ret;
+ }
video_device_create_file(vfd, &class_device_attr_name);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
video_device_create_file(vfd, &class_device_attr_dev);