From: Chen Gang <gang.chen@asianux•com>
To: David Miller <davem@davemloft•net>,
"dhowells@redhat•com" <dhowells@redhat•com>,
"Eric W. Biederman" <ebiederm@xmission•com>,
Rusty Russell <rusty@rustcorp•com.au>,
Serge Hallyn <serge.hallyn@canonical•com>
Cc: netdev <netdev@vger•kernel.org>
Subject: [PATCH] Net: rxrpc: signed and unsigned issue, need type cast for n_elem.
Date: Mon, 22 Apr 2013 18:24:00 +0800 [thread overview]
Message-ID: <51750FC0.8000603@asianux.com> (raw)
n_elem is unsigned int which never < 0.
but it seems, we realy need check it whether < 0.
so need a type cast for it.
find it by EXTRA_CFLAGS=-W
Signed-off-by: Chen Gang <gang.chen@asianux•com>
---
net/rxrpc/ar-key.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c
index 7633a75..ba0b722 100644
--- a/net/rxrpc/ar-key.c
+++ b/net/rxrpc/ar-key.c
@@ -346,7 +346,7 @@ static int rxrpc_krb5_decode_tagged_array(struct krb5_tagged_data **_td,
n_elem = ntohl(*xdr++);
toklen -= 4;
- if (n_elem < 0 || n_elem > max_n_elem)
+ if ((int)n_elem < 0 || n_elem > max_n_elem)
return -EINVAL;
*_n_elem = n_elem;
if (n_elem > 0) {
--
1.7.7.6
next reply other threads:[~2013-04-22 10:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 10:24 Chen Gang [this message]
2013-04-22 19:34 ` [PATCH] Net: rxrpc: signed and unsigned issue, need type cast for n_elem Ben Hutchings
2013-04-23 1:24 ` Chen Gang
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=51750FC0.8000603@asianux.com \
--to=gang.chen@asianux$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=dhowells@redhat$(echo .)com \
--cc=ebiederm@xmission$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=rusty@rustcorp$(echo .)com.au \
--cc=serge.hallyn@canonical$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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