aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx231xx/cx231xx-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-input.c')
-rw-r--r--drivers/media/video/cx231xx/cx231xx-input.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-input.c b/drivers/media/video/cx231xx/cx231xx-input.c
index 58dd39bc678..cd135f01b9c 100644
--- a/drivers/media/video/cx231xx/cx231xx-input.c
+++ b/drivers/media/video/cx231xx/cx231xx-input.c
@@ -197,7 +197,11 @@ int cx231xx_ir_init(struct cx231xx *dev)
197 usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); 197 usb_make_path(dev->udev, ir->phys, sizeof(ir->phys));
198 strlcat(ir->phys, "/input0", sizeof(ir->phys)); 198 strlcat(ir->phys, "/input0", sizeof(ir->phys));
199 199
200 ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER, dev->board.ir_codes); 200 err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER,
201 dev->board.ir_codes);
202 if (err < 0)
203 goto err_out_free;
204
201 input_dev->name = ir->name; 205 input_dev->name = ir->name;
202 input_dev->phys = ir->phys; 206 input_dev->phys = ir->phys;
203 input_dev->id.bustype = BUS_USB; 207 input_dev->id.bustype = BUS_USB;
@@ -222,6 +226,7 @@ err_out_stop:
222 cx231xx_ir_stop(ir); 226 cx231xx_ir_stop(ir);
223 dev->ir = NULL; 227 dev->ir = NULL;
224err_out_free: 228err_out_free:
229 ir_input_free(input_dev);
225 input_free_device(input_dev); 230 input_free_device(input_dev);
226 kfree(ir); 231 kfree(ir);
227 return err; 232 return err;
@@ -236,6 +241,7 @@ int cx231xx_ir_fini(struct cx231xx *dev)
236 return 0; 241 return 0;
237 242
238 cx231xx_ir_stop(ir); 243 cx231xx_ir_stop(ir);
244 ir_input_free(ir->input);
239 input_unregister_device(ir->input); 245 input_unregister_device(ir->input);
240 kfree(ir); 246 kfree(ir);
241 247