mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Input: synaptics-rmi4 - fix an unchecked out of memory error path
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 <[email protected]> Reviewed-by: Andrew Duggan <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
This commit is contained in:
parent
664b0bae0b
commit
839c422736
1 changed files with 5 additions and 2 deletions
|
|
@ -147,8 +147,11 @@ static int rmi_spi_xfer(struct rmi_spi_xport *rmi_spi,
|
|||
if (len > RMI_SPI_XFER_SIZE_LIMIT)
|
||||
return -EINVAL;
|
||||
|
||||
if (rmi_spi->xfer_buf_size < len)
|
||||
rmi_spi_manage_pools(rmi_spi, len);
|
||||
if (rmi_spi->xfer_buf_size < len) {
|
||||
ret = rmi_spi_manage_pools(rmi_spi, len);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (addr == 0)
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue