Re: [PATCH] wan: fix a missing check of spi_write_then_read

2018-12-27 Thread David Miller
From: Kangjie Lu Date: Tue, 25 Dec 2018 22:34:41 -0600 > When spi_write_then_read() fails, "data" can be uninitialized and thus > may contain a random value; the following execution checks "data" with a > mask, the result could be random. > > The fix inserts a check of spi_write_then_read(): if

[PATCH] wan: fix a missing check of spi_write_then_read

2018-12-25 Thread Kangjie Lu
When spi_write_then_read() fails, "data" can be uninitialized and thus may contain a random value; the following execution checks "data" with a mask, the result could be random. The fix inserts a check of spi_write_then_read(): if it fails, always returns -1. Signed-off-by: Kangjie Lu --- drive