Browse Source

HID: i2c-hid: fix memory leak during probe

In case we are returning from i2c_hid_probe() through the 'err' or
'err_mem_free' labels, there is noone freeing the buffers allocated by
i2c_hid_alloc_buffers().

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Jiri Kosina 12 years ago
parent
commit
3c62602434
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/hid/i2c-hid/i2c-hid.c

+ 1 - 0
drivers/hid/i2c-hid/i2c-hid.c

@@ -892,6 +892,7 @@ err:
 	if (ihid->irq)
 		free_irq(ihid->irq, ihid);
 
+	i2c_hid_free_buffers(ihid);
 	kfree(ihid);
 	return ret;
 }