On Fri, Sep 01, 2017 at 03:08:15PM +0200, Marcin Wojtas wrote: > From: Joe Zhou <[email protected]> > > This patch prevents possible NULL pointer dereference > during SPI transfers. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Joe Zhou <[email protected]> > Signed-off-by: Marcin Wojtas <[email protected]>
Reviewed-by: Leif Lindholm <[email protected]> > --- > Platform/Marvell/Drivers/Spi/MvSpiDxe.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/Platform/Marvell/Drivers/Spi/MvSpiDxe.c > b/Platform/Marvell/Drivers/Spi/MvSpiDxe.c > index 0872f61..6ddfcf6 100755 > --- a/Platform/Marvell/Drivers/Spi/MvSpiDxe.c > +++ b/Platform/Marvell/Drivers/Spi/MvSpiDxe.c > @@ -226,9 +226,8 @@ MvSpiTransfer ( > // Wait for memory ready > for (Iterator = 0; Iterator < SPI_TIMEOUT; Iterator++) { > if (MmioRead32 (SpiRegBase + SPI_INT_CAUSE_REG)) { > - *DataInPtr = MmioRead32 (SpiRegBase + SPI_DATA_IN_REG); > - > if (DataInPtr != NULL) { > + *DataInPtr = MmioRead32 (SpiRegBase + SPI_DATA_IN_REG); > DataInPtr++; > } > if (DataOutPtr != NULL) { > -- > 1.8.3.1 > _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

