mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
mtd: spi-nor: Fix the issue of buffer contamination
spi_nor_write_sr will pollute the buffer of sr_cr buffer when calling spi_nor_read_sr. Change-Id: I217141297df4f448b64c61f1573e7e40d6874903 Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
@@ -940,13 +940,12 @@ int spi_nor_write_16bit_cr_and_check(struct spi_nor *nor, u8 cr)
|
||||
return ret;
|
||||
|
||||
sr_cr[1] = cr;
|
||||
sr_written = sr_cr[0];
|
||||
|
||||
ret = spi_nor_write_sr(nor, sr_cr, 2);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
sr_written = sr_cr[0];
|
||||
|
||||
ret = spi_nor_read_sr(nor, sr_cr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user