Skip to content

Commit

Permalink
V4L/DVB (4413): Konicawc - handle errors from input_register_device()
Browse files Browse the repository at this point in the history
Compile-tested only (no hardware)

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Dmitry Torokhov authored and Mauro Carvalho Chehab committed Sep 26, 2006
1 parent 5aff308 commit 56b8df1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/media/video/usbvideo/konicawc.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ static void konicawc_adjust_picture(struct uvd *uvd)
static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev)
{
struct input_dev *input_dev;
int error;

usb_make_path(dev, cam->input_physname, sizeof(cam->input_physname));
strncat(cam->input_physname, "/input0", sizeof(cam->input_physname));
Expand All @@ -242,7 +243,13 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev

input_dev->private = cam;

input_register_device(cam->input);
error = input_register_device(cam->input);
if (error) {
warn("Failed to register camera's input device, err: %d\n",
error);
input_free_device(cam->input);
cam->input = NULL;
}
}

static void konicawc_unregister_input(struct konicawc *cam)
Expand Down

0 comments on commit 56b8df1

Please sign in to comment.