diff options
author | David S. Miller <davem@davemloft.net> | 2010-09-20 15:40:35 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-09 13:24:19 -0800 |
commit | 8ccbc9f2b9e169412c9b92d1a3e1de1dac9a9783 (patch) | |
tree | 9b46e639af17802243d86eb9802c245ad754a5a9 /net | |
parent | 7c873a37d10ef7e9291b812421d7e6ef52f4793a (diff) |
rose: Fix signedness issues wrt. digi count.
[ Upstream commit 9828e6e6e3f19efcb476c567b9999891d051f52f ]
Just use explicit casts, since we really can't change the
types of structures exported to userspace which have been
around for 15 years or so.
Reported-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/rose/af_rose.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index f132243abcc..103c252fbdc 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -680,7 +680,7 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1) return -EINVAL; - if (addr->srose_ndigis > ROSE_MAX_DIGIS) + if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS) return -EINVAL; if ((dev = rose_dev_get(&addr->srose_addr)) == NULL) { @@ -740,7 +740,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1) return -EINVAL; - if (addr->srose_ndigis > ROSE_MAX_DIGIS) + if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS) return -EINVAL; /* Source + Destination digis should not exceed ROSE_MAX_DIGIS */ |