Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40716
b: refs/heads/master
c: 4bdbd28
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov committed Nov 24, 2006
1 parent 3de051b commit 35a9e46
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4477d2d1bc3e6c76e83926f7fa8c8f94ba42615
refs/heads/master: 4bdbd2807deeccc0793d57fb5120d7a53f2c0b3c
10 changes: 7 additions & 3 deletions trunk/drivers/macintosh/adbhid.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,6 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
if (!hid || !input_dev) {
err = -ENOMEM;
goto fail;

}

sprintf(hid->phys, "adb%d:%d.%02x/input", id, default_id, original_handler_id);
Expand Down Expand Up @@ -807,7 +806,9 @@ adbhid_input_register(int id, int default_id, int original_handler_id,

input_dev->keycode = hid->keycode;

input_register_device(input_dev);
err = input_register_device(input_dev);
if (err)
goto fail;

if (default_id == ADB_KEYBOARD) {
/* HACK WARNING!! This should go away as soon there is an utility
Expand All @@ -820,7 +821,10 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
return 0;

fail: input_free_device(input_dev);
kfree(hid);
if (hid) {
kfree(hid->keycode);
kfree(hid);
}
adbhid[id] = NULL;
return err;
}
Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/macintosh/mac_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ EXPORT_SYMBOL(mac_hid_mouse_emulate_buttons);

static int emumousebtn_input_register(void)
{
int ret;

emumousebtn = input_allocate_device();
if (!emumousebtn)
return -ENOMEM;
Expand All @@ -120,9 +122,11 @@ static int emumousebtn_input_register(void)
emumousebtn->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
emumousebtn->relbit[0] = BIT(REL_X) | BIT(REL_Y);

input_register_device(emumousebtn);
ret = input_register_device(emumousebtn);
if (ret)
input_free_device(emumousebtn);

return 0;
return ret;
}

int __init mac_hid_init(void)
Expand Down

0 comments on commit 35a9e46

Please sign in to comment.