[PATCH] mtd: spi-nor: fix wrong "fully unlocked" test

Brian Norris computersforpeace at gmail.com
Sat Jul 9 19:30:33 PDT 2016


On Fri, Jun 24, 2016 at 10:38:14AM -0700, Brian Norris wrote:
> In stm_unlock(), the test to determine whether we've fully unlocked the
> flash checks for the lock length to be equal to the flash size. That is
> a typo/think-o -- the condition actually means the flash is completely
> *locked.* We should be using the inverse condition -- that the lock
> length is 0 (i.e., no protection).
> 
> The result of this bug is that we never actually turn off the Status
> Register Write Disable bit, even if the flash is completely unlocked.
> Now we can.
> 
> Fixes: 47b8edbf0d43 ("mtd: spi-nor: disallow further writes to SR if WP# is low")
> Reported-by: Giorgio <giorgio.nicole at arcor.de>
> Signed-off-by: Brian Norris <computersforpeace at gmail.com>
> Cc: Ezequiel Garcia <ezequiel at vanguardiasur.com.ar>

Applied to l2-mtd.git



More information about the linux-mtd mailing list