Re: [PATCH 1/1] spi: imx: fix issue when tx_buf or rx_buf is NULL

2017-05-19 Thread Mark Brown
On Fri, May 19, 2017 at 04:15:01PM +0300, Andy Shevchenko wrote: > On Fri, May 19, 2017 at 3:45 PM, Chris Ruehl wrote: > > But I think we missing something here. We return from a void function() > > so the error keeps hidden. The root cause is calling this functions with a > > NULL pointer. See i

Re: [PATCH 1/1] spi: imx: fix issue when tx_buf or rx_buf is NULL

2017-05-19 Thread Andy Shevchenko
On Fri, May 19, 2017 at 3:45 PM, Chris Ruehl wrote: > On Thursday, May 18, 2017 06:01 PM, jiada_w...@mentor.com wrote: > But I think we missing something here. We return from a void function() > so the error keeps hidden. The root cause is calling this functions with a > NULL pointer. See if you

Re: [PATCH 1/1] spi: imx: fix issue when tx_buf or rx_buf is NULL

2017-05-19 Thread Chris Ruehl
On Thursday, May 18, 2017 06:01 PM, jiada_w...@mentor.com wrote: From: Jiada Wang In case either transfer->tx_buf or transfer->rx_buf is NULL, manipulation of buffer in spi_imx_u32_swap_u[8|16]() will cause NULL pointer dereference crash. Add buffer check at very beginning of spi_imx_u32_swap

Re: [PATCH 1/1] spi: imx: fix issue when tx_buf or rx_buf is NULL

2017-05-18 Thread Leonard Crestez
On Thu, 2017-05-18 at 03:01 -0700, jiada_w...@mentor.com wrote: > From: Jiada Wang > > In case either transfer->tx_buf or transfer->rx_buf is NULL, > manipulation of buffer in spi_imx_u32_swap_u[8|16]() will cause > NULL pointer dereference crash. > > Add buffer check at very beginning of spi_im

[PATCH 1/1] spi: imx: fix issue when tx_buf or rx_buf is NULL

2017-05-18 Thread jiada_wang
From: Jiada Wang In case either transfer->tx_buf or transfer->rx_buf is NULL, manipulation of buffer in spi_imx_u32_swap_u[8|16]() will cause NULL pointer dereference crash. Add buffer check at very beginning of spi_imx_u32_swap_u[8|16](), to avoid such crash. Signed-off-by: Jiada Wang Reporte