Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68676
b: refs/heads/master
c: 709d27c
h: refs/heads/master
v: v3
  • Loading branch information
Mariusz Kozlowski authored and Jiri Kosina committed Oct 14, 2007
1 parent 0af30ae commit c9d8397
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 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: 86166b7bcda0bcb53525114fa1c87ac432be478e
refs/heads/master: 709d27c04f4eccbc99d57a5569bce028915a4345
14 changes: 10 additions & 4 deletions trunk/drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,19 @@ EXPORT_SYMBOL_GPL(hidraw_report_event);

int hidraw_connect(struct hid_device *hid)
{
int minor, result = -EINVAL;
int minor, result;
struct hidraw *dev;

/* TODO currently we accept any HID device. This should later
* probably be fixed to accept only those devices which provide
* non-input applications
*/

if (!(dev = kzalloc(sizeof(struct hidraw), GFP_KERNEL)))
return -1;
dev = kzalloc(sizeof(struct hidraw), GFP_KERNEL);
if (!dev)
return -ENOMEM;

result = -EINVAL;

spin_lock(&minors_lock);

Expand All @@ -305,8 +308,10 @@ int hidraw_connect(struct hid_device *hid)

spin_unlock(&minors_lock);

if (result)
if (result) {
kfree(dev);
goto out;
}

dev->dev = device_create(hidraw_class, NULL, MKDEV(hidraw_major, minor),
"%s%d", "hidraw", minor);
Expand All @@ -316,6 +321,7 @@ int hidraw_connect(struct hid_device *hid)
hidraw_table[minor] = NULL;
spin_unlock(&minors_lock);
result = PTR_ERR(dev->dev);
kfree(dev);
goto out;
}

Expand Down

0 comments on commit c9d8397

Please sign in to comment.