Input: synaptics-rmi4 - fix an unchecked out of memory error path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 6 Apr 2018 22:36:11 +0000 (15:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:02:40 +0000 (04:02 +0900)
commit176ebf4df9710fefe751d6565c35da5a45aeece3
treedb359518afff583645b1e48edf6addf1501a797b
parent65783949c813d0cad88b6a30f47737e8dfc00c86
Input: synaptics-rmi4 - fix an unchecked out of memory error path

[ Upstream commit 839c42273617787318da7baf6151d553108f5e17 ]

When extending the rmi_spi buffers, we must check that no out of memory
error occurs, otherwise we may access data above the currently allocated
memory.

Propagate the error code returned by 'rmi_spi_manage_pools()' instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andrew Duggan <aduggan@synaptics.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/rmi4/rmi_spi.c