Commit 176ebf4d authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman

Input: synaptics-rmi4 - fix an unchecked out of memory error path

[ Upstream commit 839c4227 ]

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

Propagate the error code returned by 'rmi_spi_manage_pools()' instead.
Signed-off-by: default avatarChristophe JAILLET <>
Reviewed-by: default avatarAndrew Duggan <>
Signed-off-by: default avatarDmitry Torokhov <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 65783949
......@@ -147,8 +147,11 @@ static int rmi_spi_xfer(struct rmi_spi_xport *rmi_spi,
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)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment