Skip to contentSkip to conversation

ubifs: fix small error path mismatch

PATCH New Daniel Mack 2 participants 2 messages Jun 4, 2009 – Jun 9, 2009 UBI file system (UBIFS)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ubifs: fix small error path mismatch

In do_readpage(), don't free 'dn' if its allocation failed.

---
 fs/ubifs/ubifs.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
fs/ubifs/ubifs.c +2 -4
index 91fc574..8ede188 100644
@@ -554,10 +554,8 @@ static int do_readpage(struct ubifs_info *c, struct inode *inode, struct page *p
 	}
 
 	dn = kmalloc(UBIFS_MAX_DATA_NODE_SZ, GFP_NOFS);
-	if (!dn) {
-		err = -ENOMEM;
-		goto error;
-	}
+	if (!dn)
+		return -ENOMEM;
 
 	i = 0;
 	while (1) {
Signature · 1 line
1.6.3.1
#1 lore raw

PATCH 1/1 ubifs: fix small error path mismatch

Dear Daniel Mack,

Quoted 6 lines · In message <[email protected]> you wrote:

In do_readpage(), don't free 'dn' if its allocation failed.

---
 fs/ubifs/ubifs.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The manager will be continually amazed that policies he took for com-
mon knowledge are totally unknown by some member of his  team.  Since
his fundamental job is to keep everybody going in the same direction,
his chief daily task will be communication, not decision-making.
                              - Fred Brooks, "The Mythical Man Month"