Skip to content

Commit

Permalink
HID: i2c-hid: also call i2c_hid_free_buffers in i2c_hid_remove
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Dec 5, 2012
1 parent 9972dcc commit 134ebfd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/hid/i2c-hid/i2c-hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 134ebfd

Please sign in to comment.