]> git.sur5r.net Git - u-boot/commit
spi: fsl_qspi: Fix qspi_op_rdid memcpy issue
authorGong Qianyu <Qianyu.Gong@freescale.com>
Tue, 26 Jan 2016 07:06:40 +0000 (15:06 +0800)
committerYork Sun <york.sun@nxp.com>
Wed, 27 Jan 2016 16:28:04 +0000 (08:28 -0800)
commit5207014deb1a465d2ac808254902100e7ea69d75
treee4f2f5d7483e9c8a330d02b8d37628982121fb86
parentc2a4cb17b4ff194e905df76b9f7c1b5a00b99b25
spi: fsl_qspi: Fix qspi_op_rdid memcpy issue

In current driver everytime we memcpy 4 bytes to the dest memory
regardless of the remaining length.
This patch adds checking the remaining length before memcpy.
If the length is shorter than 4 bytes, memcpy the actual length of data
to the dest memory.

Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
Reviewed-by: York Sun <york.sun@nxp.com>
drivers/spi/fsl_qspi.c