summaryrefslogtreecommitdiff
path: root/drivers/rapidio
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2015-07-14 04:03:44 +0300
committerJiri Kosina <jkosina@suse.com>2015-07-17 12:24:28 +0300
commitd9f2d203ab42f099b32ec4580e43eb08b3e4c412 (patch)
tree7c54c2885bf835fc03c41027ae303e49ae8c3cbe /drivers/rapidio
parent57f7e160a137f8ddae455f15abed9bdd1b90ab63 (diff)
downloadlinux-d9f2d203ab42f099b32ec4580e43eb08b3e4c412.tar.xz
HID: wacom: Properly free inputs if 'wacom_allocate_inputs' fails
The 'wacom_allocate_inputs' function tries to allocate three input devices: one each for the pen, touch, and pad. The pointers that are returned by the 'wacom_allocate_input' calls are temporarily stored to local variables where they are checked to ensure they're non-null before storing them in the 'wacom_wac' structure. If an allocation fails, the 'wacom_free_inputs' function is called to reclaim the memory. Unfortunately, 'wacom_free_inputs' is called prior to the pointers being copied, so it is not actually able to free anything. This patch has the calls to 'wacom_allocate_input' store the pointer directly in the 'wacom_wac' structure where they can be freed. Also, it replaces the call to 'wacom_free_inputs' with the (more general) 'wacom_clean_inputs' and removes the no-longer-used function. [jkosina@suse.com: modify to resolve conflict with 67e123f ("Delete unnecessary checks")] Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'drivers/rapidio')
0 files changed, 0 insertions, 0 deletions