1
0
Fork 0

HID: i2c-hid: also call i2c_hid_free_buffers in i2c_hid_remove

In the case where the hid driver in charge of handling the hid part
of the device (hid-generic for instance) fails at probe, neither
i2c_hid_start nor i2c_hid_stop are called.
Thus, the buffers allocated in i2c_hid_probe are never freed.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
hifive-unleashed-5.1
Benjamin Tissoires 2012-12-04 16:27:54 +01:00 committed by Jiri Kosina
parent 9972dcc29c
commit 134ebfd86b
1 changed files with 3 additions and 0 deletions

View File

@ -908,6 +908,9 @@ static int __devexit i2c_hid_remove(struct i2c_client *client)
free_irq(client->irq, ihid);
if (ihid->bufsize)
i2c_hid_free_buffers(ihid);
kfree(ihid);
return 0;