mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 22:22:51 -04:00
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>
This commit is contained in:
@@ -892,6 +892,7 @@ static int __devinit i2c_hid_probe(struct i2c_client *client,
|
||||
if (ihid->irq)
|
||||
free_irq(ihid->irq, ihid);
|
||||
|
||||
i2c_hid_free_buffers(ihid);
|
||||
kfree(ihid);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user