aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-input.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-input.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
index fea882d1fbc..469e083dd5f 100644
--- a/drivers/media/video/cx23885/cx23885-input.c
+++ b/drivers/media/video/cx23885/cx23885-input.c
@@ -377,7 +377,10 @@ int cx23885_input_init(struct cx23885_dev *dev)
377 cx23885_boards[dev->board].name); 377 cx23885_boards[dev->board].name);
378 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(dev->pci)); 378 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(dev->pci));
379 379
380 ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); 380 ret = ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
381 if (ret < 0)
382 goto err_out_free;
383
381 input_dev->name = ir->name; 384 input_dev->name = ir->name;
382 input_dev->phys = ir->phys; 385 input_dev->phys = ir->phys;
383 input_dev->id.bustype = BUS_PCI; 386 input_dev->id.bustype = BUS_PCI;
@@ -404,6 +407,7 @@ err_out_stop:
404 cx23885_input_ir_stop(dev); 407 cx23885_input_ir_stop(dev);
405 dev->ir_input = NULL; 408 dev->ir_input = NULL;
406err_out_free: 409err_out_free:
410 ir_input_free(input_dev);
407 input_free_device(input_dev); 411 input_free_device(input_dev);
408 kfree(ir); 412 kfree(ir);
409 return ret; 413 return ret;
@@ -416,6 +420,7 @@ void cx23885_input_fini(struct cx23885_dev *dev)
416 420
417 if (dev->ir_input == NULL) 421 if (dev->ir_input == NULL)
418 return; 422 return;
423 ir_input_free(dev->ir_input->dev);
419 input_unregister_device(dev->ir_input->dev); 424 input_unregister_device(dev->ir_input->dev);
420 kfree(dev->ir_input); 425 kfree(dev->ir_input);
421 dev->ir_input = NULL; 426 dev->ir_input = NULL;