diff options
Diffstat (limited to 'drivers/media/video/cx88/cx88-cards.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index cbd5d119a2c6..cd8c3bf698ea 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -3693,7 +3693,14 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) return NULL; } + if (v4l2_ctrl_handler_init(&core->hdl, 13)) { + v4l2_device_unregister(&core->v4l2_dev); + kfree(core); + return NULL; + } + if (0 != cx88_get_resources(core, pci)) { + v4l2_ctrl_handler_free(&core->hdl); v4l2_device_unregister(&core->v4l2_dev); kfree(core); return NULL; @@ -3706,6 +3713,10 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) core->bmmio = (u8 __iomem *)core->lmmio; if (core->lmmio == NULL) { + release_mem_region(pci_resource_start(pci, 0), + pci_resource_len(pci, 0)); + v4l2_ctrl_handler_free(&core->hdl); + v4l2_device_unregister(&core->v4l2_dev); kfree(core); return NULL; } |