public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] UBI: fix missing brace control flow
@ 2015-02-23 21:07 Brian Norris
  2015-02-23 21:21 ` Richard Weinberger
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Norris @ 2015-02-23 21:07 UTC (permalink / raw)
  To: Artem Bityutskiy, Richard Weinberger
  Cc: Brian Norris, linux-mtd, Dan Carpenter

commit 0e707ae79ba3 ("UBI: do propagate positive error codes up") seems
to have produced an unintended change in the control flow here.

Completely untested, but it looks obvious.

Caught by Coverity, which didn't like the indentation. CID 1271184.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
---
Should go into 4.0, I expect.

 drivers/mtd/ubi/eba.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index da4c79259f67..16e34b37d134 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -425,9 +425,10 @@ retry:
 					ubi_warn(ubi, "corrupted VID header at PEB %d, LEB %d:%d",
 						 pnum, vol_id, lnum);
 					err = -EBADMSG;
-				} else
+				} else {
 					err = -EINVAL;
 					ubi_ro_mode(ubi);
+				}
 			}
 			goto out_free;
 		} else if (err == UBI_IO_BITFLIPS)
-- 
1.9.1

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

* Re: [PATCH] UBI: fix missing brace control flow
  2015-02-23 21:07 [PATCH] UBI: fix missing brace control flow Brian Norris
@ 2015-02-23 21:21 ` Richard Weinberger
  2015-03-16 18:08   ` Brian Norris
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Weinberger @ 2015-02-23 21:21 UTC (permalink / raw)
  To: Brian Norris, Artem Bityutskiy; +Cc: linux-mtd, Dan Carpenter

Am 23.02.2015 um 22:07 schrieb Brian Norris:
> commit 0e707ae79ba3 ("UBI: do propagate positive error codes up") seems
> to have produced an unintended change in the control flow here.
> 
> Completely untested, but it looks obvious.
> 
> Caught by Coverity, which didn't like the indentation. CID 1271184.
> 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Should go into 4.0, I expect.

Good catch, patch tested and applied!

Thank you Brian!
//richard

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

* Re: [PATCH] UBI: fix missing brace control flow
  2015-02-23 21:21 ` Richard Weinberger
@ 2015-03-16 18:08   ` Brian Norris
  2015-03-16 18:21     ` Richard Weinberger
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Norris @ 2015-03-16 18:08 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-mtd, Dan Carpenter, Artem Bityutskiy

On Mon, Feb 23, 2015 at 10:21:53PM +0100, Richard Weinberger wrote:
> Am 23.02.2015 um 22:07 schrieb Brian Norris:
> > commit 0e707ae79ba3 ("UBI: do propagate positive error codes up") seems
> > to have produced an unintended change in the control flow here.
> > 
> > Completely untested, but it looks obvious.
> > 
> > Caught by Coverity, which didn't like the indentation. CID 1271184.
> > 
> > Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> > Cc: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > Should go into 4.0, I expect.
> 
> Good catch, patch tested and applied!

Is this going in 4.0? It fixes a typo in a hastily-applied patch that
made it to 4.0-rc1.

I'm also not sure I understand the role of the +linux-next and +master
branches in linux-ubifs.git. Typically 'next' means for the current+1
release (i.e., 4.1), while 'not-next' (i.e., your master branch?) would
be for the current release (4.0). But you have +master based on top of
+linux-next.

Brian

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

* Re: [PATCH] UBI: fix missing brace control flow
  2015-03-16 18:08   ` Brian Norris
@ 2015-03-16 18:21     ` Richard Weinberger
  2015-03-17  9:08       ` Artem Bityutskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Weinberger @ 2015-03-16 18:21 UTC (permalink / raw)
  To: Brian Norris; +Cc: linux-mtd, Dan Carpenter, Artem Bityutskiy

Hi!

Am 16.03.2015 um 19:08 schrieb Brian Norris:
> On Mon, Feb 23, 2015 at 10:21:53PM +0100, Richard Weinberger wrote:
>> Am 23.02.2015 um 22:07 schrieb Brian Norris:
>>> commit 0e707ae79ba3 ("UBI: do propagate positive error codes up") seems
>>> to have produced an unintended change in the control flow here.
>>>
>>> Completely untested, but it looks obvious.
>>>
>>> Caught by Coverity, which didn't like the indentation. CID 1271184.
>>>
>>> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
>>> Cc: Dan Carpenter <dan.carpenter@oracle.com>
>>> ---
>>> Should go into 4.0, I expect.
>>
>> Good catch, patch tested and applied!
> 
> Is this going in 4.0? It fixes a typo in a hastily-applied patch that
> made it to 4.0-rc1.

That's the plan.

> I'm also not sure I understand the role of the +linux-next and +master
> branches in linux-ubifs.git. Typically 'next' means for the current+1
> release (i.e., 4.1), while 'not-next' (i.e., your master branch?) would
> be for the current release (4.0). But you have +master based on top of
> +linux-next.

I'm using Artem's scheme. next is the branch Linus pulls from.
Artem, why are the two UBIFS fixes from master not in next?
I thought you want to send a pull request to Linus?
If you want, I can do that. I'm anyway preparing some UBI fixes.

Thanks,
//richard

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

* Re: [PATCH] UBI: fix missing brace control flow
  2015-03-16 18:21     ` Richard Weinberger
@ 2015-03-17  9:08       ` Artem Bityutskiy
  0 siblings, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2015-03-17  9:08 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: Brian Norris, linux-mtd, Dan Carpenter

On Mon, 2015-03-16 at 19:21 +0100, Richard Weinberger wrote:
> Hi!
> 
> Am 16.03.2015 um 19:08 schrieb Brian Norris:
> > On Mon, Feb 23, 2015 at 10:21:53PM +0100, Richard Weinberger wrote:
> >> Am 23.02.2015 um 22:07 schrieb Brian Norris:
> >>> commit 0e707ae79ba3 ("UBI: do propagate positive error codes up") seems
> >>> to have produced an unintended change in the control flow here.
> >>>
> >>> Completely untested, but it looks obvious.
> >>>
> >>> Caught by Coverity, which didn't like the indentation. CID 1271184.
> >>>
> >>> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> >>> Cc: Dan Carpenter <dan.carpenter@oracle.com>
> >>> ---
> >>> Should go into 4.0, I expect.
> >>
> >> Good catch, patch tested and applied!
> > 
> > Is this going in 4.0? It fixes a typo in a hastily-applied patch that
> > made it to 4.0-rc1.
> 
> That's the plan.
> 
> > I'm also not sure I understand the role of the +linux-next and +master
> > branches in linux-ubifs.git. Typically 'next' means for the current+1
> > release (i.e., 4.1), while 'not-next' (i.e., your master branch?) would
> > be for the current release (4.0). But you have +master based on top of
> > +linux-next.
> 
> I'm using Artem's scheme. next is the branch Linus pulls from.
> Artem, why are the two UBIFS fixes from master not in next?

Just wanted to keep them there for several days.

> I thought you want to send a pull request to Linus?

No, I was not going to send this for 4.0. There is one fix which looks
important, but on the other hand, I did not test it, and no one reported
this problem and said this patch helps, so I was not going to send it
earlier.

> If you want, I can do that. I'm anyway preparing some UBI fixes.

Yes, please, merge master to linux-next.

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

end of thread, other threads:[~2015-03-17  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23 21:07 [PATCH] UBI: fix missing brace control flow Brian Norris
2015-02-23 21:21 ` Richard Weinberger
2015-03-16 18:08   ` Brian Norris
2015-03-16 18:21     ` Richard Weinberger
2015-03-17  9:08       ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox