From: Brian Norris <computersforpeace@gmail.com>
To: <linux-mtd@lists.infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>,
Christian Riesch <christian.riesch@omicron.at>
Subject: [PATCH] mtd: cfi_cmdset_0002: check return code for get_chip()
Date: Wed, 13 Aug 2014 23:35:24 -0700 [thread overview]
Message-ID: <1407998124-3166-1-git-send-email-computersforpeace@gmail.com> (raw)
Untested
Coverity CID 1230633
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Christian Riesch <christian.riesch@omicron.at>
---
drivers/mtd/chips/cfi_cmdset_0002.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 6da141af9cba..c50d8cf0f60d 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,
--
1.7.9.5
next reply other threads:[~2014-08-14 6:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-14 6:35 Brian Norris [this message]
2014-08-14 8:30 ` [PATCH] mtd: cfi_cmdset_0002: check return code for get_chip() Christian Riesch
2014-08-16 1:16 ` Brian Norris
2014-08-19 19:12 ` Brian Norris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407998124-3166-1-git-send-email-computersforpeace@gmail.com \
--to=computersforpeace@gmail.com \
--cc=christian.riesch@omicron.at \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox