diff options
author | Brian Norris <computersforpeace@gmail.com> | 2014-08-13 23:35:24 -0700 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-08-15 18:09:00 -0700 |
commit | 5d20bad19d25bb25d9e831dd342c7c714d872b53 (patch) | |
tree | a39850d642aac82a4aaad2b1fefb098d3e681b6f /drivers/mtd/chips | |
parent | 2a500afe1e0e84c7a126df693dbd01353756dcfa (diff) | |
download | op-kernel-dev-5d20bad19d25bb25d9e831dd342c7c714d872b53.zip op-kernel-dev-5d20bad19d25bb25d9e831dd342c7c714d872b53.tar.gz |
mtd: cfi_cmdset_0002: check return code for get_chip()
Coverity CID 1230633
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Tested-by: Christian Riesch <christian.riesch@omicron.at>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 5a4bfe3..46c4643 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -1434,6 +1434,10 @@ static int cfi_amdstd_otp_walk(struct mtd_info *mtd, loff_t from, size_t len, mutex_lock(&chip->mutex); ret = get_chip(map, chip, base, FL_LOCKING); + if (ret) { + mutex_unlock(&chip->mutex); + return ret; + } /* Enter lock register command */ cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, |