From: Johan Hedberg <johan.hedberg@gmail.com>
To: vishal agarwal <vishal.bluez@gmail.com>
Cc: linux-bluetooth@vger.kernel.org,
Vishal Agarwal <vishal.agarwal@stericsson.com>
Subject: Re: [PATCH] textfile: fix missing call to munmap in wite_key
Date: Wed, 16 May 2012 11:14:15 +0300 [thread overview]
Message-ID: <20120516081415.GA29073@x220> (raw)
In-Reply-To: <CA+_sZW8tYxCyfKrc8_r0E+toOj=HQxfDWaQTY=ezmxd6Jtg+AA@mail.gmail.com>
Hi Vishal,
On Wed, May 16, 2012, vishal agarwal wrote:
> On 5/10/12, Vishal Agarwal <vishal.agarwal@stericsson.com> wrote:
> > In some cases it was possible that munmap is not called corresponding
> > to mmap, which might result in future read or writes to fail.
> > ---
> > src/textfile.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/src/textfile.c b/src/textfile.c
> > index 2712cd8..9d88fbc 100644
> > --- a/src/textfile.c
> > +++ b/src/textfile.c
> > @@ -220,8 +220,8 @@ static int write_key(const char *pathname, const char
> > *key, const char *value, i
> > len = strlen(key);
> > off = find_key(map, size, key, len, icase);
> > if (!off) {
> > + munmap(map, size);
> > if (value) {
> > - munmap(map, size);
> > lseek(fd, size, SEEK_SET);
> > err = write_key_value(fd, key, value);
> > }
> > --
> > 1.7.0.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> > in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>
> Did you get a chance to look at it. Just to brief about the problem -
> If we try to pair unpair device many times then in certain conditions
> munmap is not called and after some times the mmap starts failing.
> which will result in nsuccessful pairing or unpairing.
> This patch fixes this issue.
Sorry, I did actually take a look at it and concluded it was correct,
but I forgot to apply it. The patch has been pushed upstream now.
Thanks.
Johan
prev parent reply other threads:[~2012-05-16 8:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-10 13:43 [PATCH] textfile: fix missing call to munmap in wite_key Vishal Agarwal
2012-05-16 8:02 ` vishal agarwal
2012-05-16 8:14 ` Johan Hedberg [this message]
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=20120516081415.GA29073@x220 \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=vishal.agarwal@stericsson.com \
--cc=vishal.bluez@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).