Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (4413): Konicawc - handle errors from input_register_device()

Compile-tested only (no hardware)

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

Dmitry Torokhov and committed by
Mauro Carvalho Chehab
56b8df11 5aff308c

+8 -1
+8 -1
drivers/media/video/usbvideo/konicawc.c
··· 222 222 static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev) 223 223 { 224 224 struct input_dev *input_dev; 225 + int error; 225 226 226 227 usb_make_path(dev, cam->input_physname, sizeof(cam->input_physname)); 227 228 strncat(cam->input_physname, "/input0", sizeof(cam->input_physname)); ··· 243 242 244 243 input_dev->private = cam; 245 244 246 - input_register_device(cam->input); 245 + error = input_register_device(cam->input); 246 + if (error) { 247 + warn("Failed to register camera's input device, err: %d\n", 248 + error); 249 + input_free_device(cam->input); 250 + cam->input = NULL; 251 + } 247 252 } 248 253 249 254 static void konicawc_unregister_input(struct konicawc *cam)