diff options
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-input.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index 439f3d54d009..744918b1cd47 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c | |||
@@ -652,7 +652,10 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
652 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", | 652 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", |
653 | pci_name(dev->pci)); | 653 | pci_name(dev->pci)); |
654 | 654 | ||
655 | ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); | 655 | err = ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); |
656 | if (err < 0) | ||
657 | goto err_out_free; | ||
658 | |||
656 | input_dev->name = ir->name; | 659 | input_dev->name = ir->name; |
657 | input_dev->phys = ir->phys; | 660 | input_dev->phys = ir->phys; |
658 | input_dev->id.bustype = BUS_PCI; | 661 | input_dev->id.bustype = BUS_PCI; |
@@ -683,6 +686,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
683 | saa7134_ir_stop(dev); | 686 | saa7134_ir_stop(dev); |
684 | dev->remote = NULL; | 687 | dev->remote = NULL; |
685 | err_out_free: | 688 | err_out_free: |
689 | ir_input_free(input_dev); | ||
686 | input_free_device(input_dev); | 690 | input_free_device(input_dev); |
687 | kfree(ir); | 691 | kfree(ir); |
688 | return err; | 692 | return err; |
@@ -694,6 +698,7 @@ void saa7134_input_fini(struct saa7134_dev *dev) | |||
694 | return; | 698 | return; |
695 | 699 | ||
696 | saa7134_ir_stop(dev); | 700 | saa7134_ir_stop(dev); |
701 | ir_input_free(dev->remote->dev); | ||
697 | input_unregister_device(dev->remote->dev); | 702 | input_unregister_device(dev->remote->dev); |
698 | kfree(dev->remote); | 703 | kfree(dev->remote); |
699 | dev->remote = NULL; | 704 | dev->remote = NULL; |