Skip to content

Commit

Permalink
mtd: cfi_cmdset_0002: check return code for get_chip()
Browse files Browse the repository at this point in the history
Coverity CID 1230633

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Tested-by: Christian Riesch <christian.riesch@omicron.at>
  • Loading branch information
Brian Norris committed Aug 16, 2014
1 parent 2a500af commit 5d20bad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mtd/chips/cfi_cmdset_0002.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5d20bad

Please sign in to comment.