aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-input.c')
-rw-r--r--drivers/media/video/cx88/cx88-input.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index 7b2066415d7e..92b8cdf9fb81 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -360,7 +360,10 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
360 snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name); 360 snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name);
361 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci)); 361 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));
362 362
363 ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); 363 err = ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
364 if (err < 0)
365 goto err_out_free;
366
364 input_dev->name = ir->name; 367 input_dev->name = ir->name;
365 input_dev->phys = ir->phys; 368 input_dev->phys = ir->phys;
366 input_dev->id.bustype = BUS_PCI; 369 input_dev->id.bustype = BUS_PCI;
@@ -390,6 +393,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
390 cx88_ir_stop(core, ir); 393 cx88_ir_stop(core, ir);
391 core->ir = NULL; 394 core->ir = NULL;
392 err_out_free: 395 err_out_free:
396 ir_input_free(input_dev);
393 input_free_device(input_dev); 397 input_free_device(input_dev);
394 kfree(ir); 398 kfree(ir);
395 return err; 399 return err;
@@ -404,6 +408,7 @@ int cx88_ir_fini(struct cx88_core *core)
404 return 0; 408 return 0;
405 409
406 cx88_ir_stop(core, ir); 410 cx88_ir_stop(core, ir);
411 ir_input_free(ir->input);
407 input_unregister_device(ir->input); 412 input_unregister_device(ir->input);
408 kfree(ir); 413 kfree(ir);
409 414