From: "Steve French" <smfrench@gmail.com>
To: chrisw@sous-sol.org
Cc: "Suresh Jayaraman" <sjayaraman@suse.de>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH]: Supress a `comparison is always false' warning in fs/cifs/asn1.c
Date: Sun, 22 Jun 2008 13:37:55 -0500 [thread overview]
Message-ID: <524f69650806221137u79aee360xb70aea7f9ccefc4b@mail.gmail.com> (raw)
In-Reply-To: <484F7B80.2030306@suse.de>
Chris,
Although this check seems harmless, shrinking the range to uint from
ulong makes sense as Suresh suggested and I was planning on adding
this to the cifs-2.6.git tree - but was not sure if you would prefer
to change both locations at once.
On Wed, Jun 11, 2008 at 2:15 AM, Suresh Jayaraman <sjayaraman@suse.de> wrote:
> On x86_64, I get this warning:
>
> fs/cifs/asn1.c: In function `asn1_oid_decode':
> fs/cifs/asn1.c:403: warning: comparison is always false due to limited
> range of data type
>
> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
> ---
>
> diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c
> index f58e41d..4bdf809 100644
> --- a/fs/cifs/asn1.c
> +++ b/fs/cifs/asn1.c
> @@ -400,7 +400,7 @@ asn1_oid_decode(struct asn1_ctx *ctx,
> size = eoc - ctx->pointer + 1;
>
> /* first subid actually encodes first two subids */
> - if (size < 2 || size > ULONG_MAX/sizeof(unsigned long))
> + if (size < 2 || size > UINT_MAX/sizeof(unsigned int))
> return 0;
>
> *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
>
>
--
Thanks,
Steve
parent reply other threads:[~2008-06-22 18:38 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <484F7B80.2030306@suse.de>]
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=524f69650806221137u79aee360xb70aea7f9ccefc4b@mail.gmail.com \
--to=smfrench@gmail.com \
--cc=chrisw@sous-sol.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sjayaraman@suse.de \
/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
all inboxes | Powered by JetHome®