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>
This commit is contained in:
Brian Norris 2014-08-13 23:35:24 -07:00
parent 2a500afe1e
commit 5d20bad19d

View File

@ -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,