]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: alps: Fix an error handling path in 'alps_input_configured()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 4 Dec 2019 03:35:25 +0000 (04:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:45:18 +0000 (16:45 +0100)
commiteb0cb1ade4b6fc9b78cdc1c48256f5c2c8e23872
tree71a6ff155afde5d0334570b7b3235a2066afaa41
parentc3114a5a6d880aa93b7e0e1123d9c9381a8de2e7
HID: alps: Fix an error handling path in 'alps_input_configured()'

commit 8d2e77b39b8fecb794e19cd006a12f90b14dd077 upstream.

They are issues:
   - if 'input_allocate_device()' fails and return NULL, there is no need
     to free anything and 'input_free_device()' call is a no-op. It can
     be axed.
   - 'ret' is known to be 0 at this point, so we must set it to a
     meaningful value before returning

Fixes: 2562756dde55 ("HID: add Alps I2C HID Touchpad-Stick support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-alps.c