]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
chcr: ensure cntrl is initialized to fix bit-wise or'ing of garabage data
authorColin Ian King <colin.king@canonical.com>
Thu, 30 Nov 2017 14:23:54 +0000 (14:23 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 11 Dec 2017 11:36:59 +0000 (22:36 +1100)
In the case where skb->ip_summed != CHECKSUM_PARTIAL then cntrl contains
garbage value and this is possibly being bit-wise or'd and stored into
cpl->ctrl1.  Fix this by initializing cntrl to zero.

Cleans up clang warning:
drivers/crypto/chelsio/chcr_ipsec.c:374:9: warning: The left expression
of the compound assignment is an uninitialized value. The computed value
will also be garbage

Fixes: 6dad4e8ab3ec ("chcr: Add support for Inline IPSec")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/chelsio/chcr_ipsec.c

index a0f003ffd1f472288cb9620713bbd7fc19159957..64a030f8fb2198003ead6ccb948541757fdda44a 100644 (file)
@@ -350,7 +350,7 @@ inline void *copy_cpltx_pktxt(struct sk_buff *skb,
        struct port_info *pi;
        struct sge_eth_txq *q;
        struct cpl_tx_pkt_core *cpl;
-       u64 cntrl;
+       u64 cntrl = 0;
        u32 ctrl0, qidx;
 
        pi = netdev_priv(dev);