aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-alps.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
index 048befde295a..0c18d473a5d8 100644
--- a/drivers/hid/hid-alps.c
+++ b/drivers/hid/hid-alps.c
@@ -383,7 +383,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)
383 383
384 input2 = input_allocate_device(); 384 input2 = input_allocate_device();
385 if (!input2) { 385 if (!input2) {
386 input_free_device(input2); 386 ret = -ENOMEM;
387 goto exit; 387 goto exit;
388 } 388 }
389 389
@@ -425,7 +425,8 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)
425 __set_bit(INPUT_PROP_POINTER, input2->propbit); 425 __set_bit(INPUT_PROP_POINTER, input2->propbit);
426 __set_bit(INPUT_PROP_POINTING_STICK, input2->propbit); 426 __set_bit(INPUT_PROP_POINTING_STICK, input2->propbit);
427 427
428 if (input_register_device(data->input2)) { 428 ret = input_register_device(data->input2);
429 if (ret) {
429 input_free_device(input2); 430 input_free_device(input2);
430 goto exit; 431 goto exit;
431 } 432 }