From: "pierre.ricadat@utbm.fr" <Pierre.Ricadat@utbm.fr>
To: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] separate routine to check jffs2_flash_read
Date: Mon, 31 Oct 2005 16:16:17 +0100 [thread overview]
Message-ID: <1130771777.4366354129c88@webmail1.utbm.fr> (raw)
In-Reply-To: <20051031143345.GB27238@wohnheim.fh-wedel.de>
Quoting Jörn Engel <joern@wohnheim.fh-wedel.de>:
> On Mon, 31 October 2005 11:12:06 +0100, pierre.ricadat@utbm.fr wrote:
> >
> > -free_out:
> > - if(!pointed)
> > - kfree(buffer);
> > -#ifndef __ECOS
> > - else
> > - c->mtd->unpoint(c->mtd, buffer, ofs, len);
> > -#endif
> > - return err;
> > }
>
> Nowhere in jffs2_flash_read_safe() do you call c->mtd->unpoint. So
> obviously your code is not equivalent to the existing. Can you look
> into it and see what needs to be don?
In fact the only place where we goto free_out was there :
@ line 449:
if (!pointed) {
buffer = kmalloc(len, GFP_KERNEL);
if (unlikely(!buffer))
return -ENOMEM;
/* TODO: this is very frequent pattern, make it a separate
* routine */
err = jffs2_flash_read(c, ofs, len, &retlen, buffer);
if (err) {
JFFS2_ERROR("can not read %d bytes from 0x%08x, error code: %d.\n", len, ofs,
err);
goto free_out;
}
if (retlen != len) {
JFFS2_ERROR("short read at %#08x: %d instead of %d.\n", ofs, retlen, len);
err = -EIO;
goto free_out;
}
}
The goto free_out was located in a if(!pointed), so the if(!pointed) in the
free_out will always be true, and c->mtd->unpoint will never be called.
--
Pierre Ricadat
next prev parent reply other threads:[~2005-10-31 15:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-26 7:32 [PATCH] separate routine to check jffs2_flash_read Pierre.Ricadat@UTBM.fr
2005-10-28 14:27 ` Jörn Engel
2005-10-31 10:12 ` pierre.ricadat@utbm.fr
2005-10-31 14:33 ` Jörn Engel
2005-10-31 15:16 ` pierre.ricadat@utbm.fr [this message]
2005-10-31 15:24 ` Jörn Engel
2005-11-11 9:44 ` Pierre.Ricadat@UTBM.fr
2005-11-11 10:08 ` Jörn Engel
[not found] ` <1131707642.43747cfa9454b@webmail2.utbm.fr>
2005-11-11 12:13 ` Jörn Engel
2005-11-11 12:25 ` Pierre.Ricadat@UTBM.fr
2005-11-13 20:36 ` Thomas Gleixner
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=1130771777.4366354129c88@webmail1.utbm.fr \
--to=pierre.ricadat@utbm.fr \
--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