From: James Morris <jmorris@namei.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Dmitry Kasatkin <dmitry.kasatkin@intel.com>,
zohar@us.ibm.com, David Howells <dhowells@redhat.com>,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] lib/mpi: Fixed erroneous check on return value of mpi_resize()
Date: Mon, 7 May 2012 11:26:29 +1000 (EST) [thread overview]
Message-ID: <alpine.LRH.2.02.1205071125510.31172@tundra.namei.org> (raw)
In-Reply-To: <201205051230.GCC69709.OQFLSOVtMHJFFO@I-love.SAKURA.ne.jp>
On Sat, 5 May 2012, Tetsuo Handa wrote:
> Adarsh J wrote:
> > mpi_resize() returns -ENOMEM on error and 0 on success.
>
> Good catch.
>
> But it seems to me that mpi_fromstr() has no in-tree users.
> Also, mpi_fromstr() in RHEL 5.8/6.2 has no users.
> We forgot to exclude when adding MPI support?
If that's the case, then it should be removed.
(Removed root@ from cc:)
>
> >
> > Signed-off-by: Adarsh J <root@hackmaster.in>
> > ---
> > lib/mpi/mpicoder.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c
> > index f26b41f..9949b69 100644
> > --- a/lib/mpi/mpicoder.c
> > +++ b/lib/mpi/mpicoder.c
> > @@ -98,7 +98,7 @@ int mpi_fromstr(MPI val, const char *str)
> > nbytes = (nbits + 7) / 8;
> > nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB;
> > if (val->alloced < nlimbs)
> > - if (!mpi_resize(val, nlimbs))
> > + if (mpi_resize(val, nlimbs) < 0)
> > return -ENOMEM;
> > i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
> > i %= BYTES_PER_MPI_LIMB;
> > --
> > 1.7.9.5
>
--
James Morris
<jmorris@namei.org>
next prev parent reply other threads:[~2012-05-07 1:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-05 1:51 [PATCH 1/1] lib/mpi: Fixed erroneous check on return value of mpi_resize() Adarsh J
2012-05-05 3:30 ` Tetsuo Handa
2012-05-07 1:26 ` James Morris [this message]
2012-05-07 13:20 ` Kasatkin, Dmitry
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=alpine.LRH.2.02.1205071125510.31172@tundra.namei.org \
--to=jmorris@namei.org \
--cc=dhowells@redhat.com \
--cc=dmitry.kasatkin@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=zohar@us.ibm.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).