summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-11-20 20:09:40 +0400
committerJiri Kosina <jkosina@suse.cz>2012-11-20 20:37:45 +0400
commit3c62602434c13744df62b3ab0ab7950cd36f24db (patch)
tree86071cf15ca76b3e0d195efd0dc199854df35deb /drivers/hid
parent4a200c3b9a40242652b5734630bdd0bcf3aca75f (diff)
downloadlinux-3c62602434c13744df62b3ab0ab7950cd36f24db.tar.xz
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>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 11140bdae660..67ab5b7b64d8 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/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;
}