diff options
author | Benjamin Tissoires <benjamin.tissoires@gmail.com> | 2012-12-04 10:27:54 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-12-05 05:26:36 -0500 |
commit | 134ebfd86b9353a3d98f9f4e93b4e79824a4b49a (patch) | |
tree | 303b2518328889258a9becfdca2fad31467b48a4 /drivers/hid/i2c-hid | |
parent | 9972dcc29cd1fc1b550656eb04496df6dab3dc42 (diff) |
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>
Diffstat (limited to 'drivers/hid/i2c-hid')
-rw-r--r-- | drivers/hid/i2c-hid/i2c-hid.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 035a0cdd129e..aab3357626c7 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c | |||
@@ -908,6 +908,9 @@ static int __devexit i2c_hid_remove(struct i2c_client *client) | |||
908 | 908 | ||
909 | free_irq(client->irq, ihid); | 909 | free_irq(client->irq, ihid); |
910 | 910 | ||
911 | if (ihid->bufsize) | ||
912 | i2c_hid_free_buffers(ihid); | ||
913 | |||
911 | kfree(ihid); | 914 | kfree(ihid); |
912 | 915 | ||
913 | return 0; | 916 | return 0; |