diff options
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r-- | drivers/hid/hid-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8d3946af9ff6..62333e9dcb3a 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -126,7 +126,7 @@ static int open_collection(struct hid_parser *parser, unsigned type) | |||
126 | 126 | ||
127 | if (parser->collection_stack_ptr == HID_COLLECTION_STACK_SIZE) { | 127 | if (parser->collection_stack_ptr == HID_COLLECTION_STACK_SIZE) { |
128 | hid_err(parser->device, "collection stack overflow\n"); | 128 | hid_err(parser->device, "collection stack overflow\n"); |
129 | return -1; | 129 | return -EINVAL; |
130 | } | 130 | } |
131 | 131 | ||
132 | if (parser->device->maxcollection == parser->device->collection_size) { | 132 | if (parser->device->maxcollection == parser->device->collection_size) { |
@@ -134,7 +134,7 @@ static int open_collection(struct hid_parser *parser, unsigned type) | |||
134 | parser->device->collection_size * 2, GFP_KERNEL); | 134 | parser->device->collection_size * 2, GFP_KERNEL); |
135 | if (collection == NULL) { | 135 | if (collection == NULL) { |
136 | hid_err(parser->device, "failed to reallocate collection array\n"); | 136 | hid_err(parser->device, "failed to reallocate collection array\n"); |
137 | return -1; | 137 | return -ENOMEM; |
138 | } | 138 | } |
139 | memcpy(collection, parser->device->collection, | 139 | memcpy(collection, parser->device->collection, |
140 | sizeof(struct hid_collection) * | 140 | sizeof(struct hid_collection) * |
@@ -170,7 +170,7 @@ static int close_collection(struct hid_parser *parser) | |||
170 | { | 170 | { |
171 | if (!parser->collection_stack_ptr) { | 171 | if (!parser->collection_stack_ptr) { |
172 | hid_err(parser->device, "collection stack underflow\n"); | 172 | hid_err(parser->device, "collection stack underflow\n"); |
173 | return -1; | 173 | return -EINVAL; |
174 | } | 174 | } |
175 | parser->collection_stack_ptr--; | 175 | parser->collection_stack_ptr--; |
176 | return 0; | 176 | return 0; |