@@ -1079,22 +1079,18 @@ static int hid_debug_rdesc_open(struct inode *inode, struct file *file)
static int hid_debug_events_open(struct inode *inode, struct file *file)
{
- int err = 0;
struct hid_debug_list *list;
unsigned long flags;
list = kzalloc(sizeof(*list), GFP_KERNEL);
- if (!list) {
- err = -ENOMEM;
- goto out;
- }
+ if (!list)
+ return -ENOMEM;
list->hid_debug_buf = kzalloc(sizeof(char) * HID_DEBUG_BUFSIZE,
GFP_KERNEL);
if (!list->hid_debug_buf) {
- err = -ENOMEM;
kfree(list);
- goto out;
+ return -ENOMEM;
}
list->hdev = (struct hid_device *) inode->i_private;
file->private_data = list;
@@ -1103,9 +1099,7 @@ static int hid_debug_events_open(struct inode *inode, struct file *file)
spin_lock_irqsave(&list->hdev->debug_list_lock, flags);
list_add_tail(&list->node, &list->hdev->debug_list);
spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags);
-
-out:
- return err;
+ return 0;
}
static ssize_t hid_debug_events_read(struct file *file, char __user *buffer,