summaryrefslogtreecommitdiff
path: root/drivers/crypto/chelsio/chtls
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-07-04 19:37:20 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-07-13 13:26:49 +0300
commitd6be72ee2c77469d4fb391ccccc2ebc1b167a242 (patch)
treeb35a052ee1c34f1c2206ceeca8e067420cf52d54 /drivers/crypto/chelsio/chtls
parentdcbc0c6e4aa1ef269179351ac615fd08ddefc849 (diff)
downloadlinux-d6be72ee2c77469d4fb391ccccc2ebc1b167a242.tar.xz
crypto: chtls - use 64-bit arithmetic instead of 32-bit
Cast *val* to u64 in order to give the compiler complete information about the proper arithmetic to use. Notice that such variable is used in a context that expects an expression of type u64 (64 bits, unsigned) and the following expression is currently being evaluated using 32-bit arithmetic: val << bit_pos Addresses-Coverity-ID: 1467425 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/chelsio/chtls')
-rw-r--r--drivers/crypto/chelsio/chtls/chtls_hw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/chelsio/chtls/chtls_hw.c b/drivers/crypto/chelsio/chtls/chtls_hw.c
index 55d50140f9e5..490960755864 100644
--- a/drivers/crypto/chelsio/chtls/chtls_hw.c
+++ b/drivers/crypto/chelsio/chtls/chtls_hw.c
@@ -97,7 +97,7 @@ static int chtls_set_tcb_field(struct sock *sk, u16 word, u64 mask, u64 val)
int chtls_set_tcb_tflag(struct sock *sk, unsigned int bit_pos, int val)
{
return chtls_set_tcb_field(sk, 1, 1ULL << bit_pos,
- val << bit_pos);
+ (u64)val << bit_pos);
}
static int chtls_set_tcb_keyid(struct sock *sk, int keyid)