]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/hid/hid-debug.c
HID: fix memory leak on error patch in debug code
[linux-beck.git] / drivers / hid / hid-debug.c
index a331a1821e858a3ee1bc0fda9caba0354e4f5adf..06e87dc7779600510ce3b08722b778a5ae6c16d4 100644 (file)
@@ -909,6 +909,7 @@ static int hid_debug_events_open(struct inode *inode, struct file *file)
 
        if (!(list->hid_debug_buf = kzalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_KERNEL))) {
                err = -ENOMEM;
+               kfree(list);
                goto out;
        }
        list->hdev = (struct hid_device *) inode->i_private;