All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: cfi_cmdset_0002: check return code for get_chip()
@ 2014-08-14  6:35 Brian Norris
  2014-08-14  8:30 ` Christian Riesch
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2014-08-14  6:35 UTC (permalink / raw)
  To: linux-mtd; +Cc: Brian Norris, Christian Riesch

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: cfi_cmdset_0002: check return code for get_chip()
  2014-08-14  6:35 [PATCH] mtd: cfi_cmdset_0002: check return code for get_chip() Brian Norris
@ 2014-08-14  8:30 ` Christian Riesch
  2014-08-16  1:16   ` Brian Norris
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Riesch @ 2014-08-14  8:30 UTC (permalink / raw)
  To: Brian Norris; +Cc: linux-mtd

Hi Brian,
Thanks for catching this!

On Thu, Aug 14, 2014 at 8:35 AM, Brian Norris
<computersforpeace@gmail.com> wrote:
> 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(+)

Tested-by: Christian Riesch <christian.riesch@omicron.at>

Regards,
Christian

>
> 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
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: cfi_cmdset_0002: check return code for get_chip()
  2014-08-14  8:30 ` Christian Riesch
@ 2014-08-16  1:16   ` Brian Norris
  2014-08-19 19:12     ` Brian Norris
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2014-08-16  1:16 UTC (permalink / raw)
  To: Christian Riesch; +Cc: linux-mtd

On Thu, Aug 14, 2014 at 10:30:32AM +0200, Christian Riesch wrote:
> Hi Brian,
> Thanks for catching this!

Don't thank me, thank Coverity (TM)! (And Dave Jones, I guess, since he
maintains the project instance.)

> On Thu, Aug 14, 2014 at 8:35 AM, Brian Norris
> <computersforpeace@gmail.com> wrote:
> > 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(+)
> 
> Tested-by: Christian Riesch <christian.riesch@omicron.at>

Thanks! Queued to linux-mtd.git/master. It'll probably go in 3.16, as
it's a fix for a new feature.

Brian

[1] http://codemonkey.org.uk/2014/08/05/linux-316-coverity-stats/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: cfi_cmdset_0002: check return code for get_chip()
  2014-08-16  1:16   ` Brian Norris
@ 2014-08-19 19:12     ` Brian Norris
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2014-08-19 19:12 UTC (permalink / raw)
  To: Christian Riesch; +Cc: linux-mtd

On Fri, Aug 15, 2014 at 6:16 PM, Brian Norris
<computersforpeace@gmail.com> wrote:
> Thanks! Queued to linux-mtd.git/master. It'll probably go in 3.16, as
> it's a fix for a new feature.

Just noticed my typo: this is of course for 3.17, not 3.16 :)

Brian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-19 19:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-14  6:35 [PATCH] mtd: cfi_cmdset_0002: check return code for get_chip() Brian Norris
2014-08-14  8:30 ` Christian Riesch
2014-08-16  1:16   ` Brian Norris
2014-08-19 19:12     ` Brian Norris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.