]> git.baikalelectronics.ru Git - kernel.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:43:45 +0000 (16:43 +0100)
commit3f8d2ed2875695d06733ee5a16fe0dbfcacd1a62
tree2b1422c0480a78f0216f14fdcd58bfdd57cecb75
parentafc82853009f6d24516fa9342414c5d9082e4c5a
HID: alps: Fix an error handling path in 'alps_input_configured()'

commit 130d0d196612cef047431e7d029e1e5f7912b965 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: bec0e0264801 ("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