mtd: spi-nor: fix iteration over smpt array
Iterate over smpt array using its starting address and length instead of the blind iterations that used data found in the array. This prevents possible memory accesses outside of the smpt array boundaries in case software, or manufacturers, misrepresent smpt array fields. Fixes: b038e8e3 ("mtd: spi-nor: parse SFDP Sector Map Parameter Table") Suggested-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
Showing
想要评论请 注册 或 登录