HID: alps: Fix memory leak
authorAxel Lin <axel.lin@ingics.com>
Sun, 11 Sep 2016 04:09:01 +0000 (12:09 +0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 19 Sep 2016 12:42:22 +0000 (14:42 +0200)
commit7ee2eaa3641827a9ecdffa190cde31846024d2e3
tree7c6bdf3921858ee77cbe7c63a7ccc62843d7383e
parentb490a8537df60d449199e162417da74ee9262515
HID: alps: Fix memory leak

A kfree(readbuf) call was missed if hid_hw_raw_request() fails, fix it.
Also avoid mixing direct return with goto in the error paths.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-alps.c