Skip to contentSkip to conversation

UBI: fix missing brace control flow

PATCH In review Brian Norris 3 participants 5 messages Feb 23, 2015 – Mar 17, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBI: fix missing brace control flow

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.

---
Should go into 4.0, I expect.

 drivers/mtd/ubi/eba.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/ubi/eba.c +2 -1
index da4c79259f67..16e34b37d134 100644
@@ -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)
Signature · 1 line
1.9.1
#1 lore raw

Am 23.02.2015 um 22:07 schrieb Brian Norris:

Quoted 11 lines

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.

---
Should go into 4.0, I expect.

Good catch, patch tested and applied!

Thank you Brian!
//richard

#2 lore raw
Quoted 6 lines · Richard Weinberger

Am 23.02.2015 um 22:07 schrieb Brian Norris:

Quoted 5 lines

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.

Quoted 8 lines
Quoted 6 lines

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

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

#3 lore raw

Hi!

Am 16.03.2015 um 19:08 schrieb Brian Norris:

Quoted 14 lines · Richard Weinberger
Quoted 13 lines

Am 23.02.2015 um 22:07 schrieb Brian Norris:

Quoted 11 lines

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.

---
Should go into 4.0, I expect.

Quoted 4 lines
Quoted 1 line

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.

Quoted 5 lines

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

#4 lore raw
Quoted 24 lines · Richard Weinberger

Hi!

Am 16.03.2015 um 19:08 schrieb Brian Norris:

Quoted 14 lines · Richard Weinberger
Quoted 13 lines

Am 23.02.2015 um 22:07 schrieb Brian Norris:

Quoted 11 lines

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.

---
Should go into 4.0, I expect.

Quoted 4 lines
Quoted 1 line

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.

Quoted 8 lines
Quoted 5 lines

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.

Quoted 1 line

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.

Quoted 1 line

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

Yes, please, merge master to linux-next.