Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3698596imm; Tue, 17 Jul 2018 08:54:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpct05fcaZ0I8qyXN1RrfjcwIwbEhuXIb9sL4MJAbPQ/UtF24L5DhXq/XJgr4xaeLnZxdBtw X-Received: by 2002:a62:c288:: with SMTP id w8-v6mr1258924pfk.92.1531842846789; Tue, 17 Jul 2018 08:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531842846; cv=none; d=google.com; s=arc-20160816; b=dKzOKuwPgTCWoIEwTSJPy8c30SgziElB/OpDFxiO5o/xlJ+mM/fIr2RcGKz4vLeD1b 8/dHazFGDeskCbPIkFw9yEjgW/xA5xDIbHF0DNpW7JRD1Kc16FZWiON60JwFVpxA4oz+ ksL6QbQBAnVnl1Bgvl0sqrYPG3ZzKiTu0mVfEk5q8AzknXib0URESDeh5gXoTmxHd176 7A0Iw97DcJKc9DV9YEEgGmX85HyPsLhs5ngUJmWidp3q95Zis0R7jCS1CkOaeVVERuOk ax25ITv+67jqPrm9upiJIv36kit4zxtSfeI/ikvRxnJL43j2vajdUmsIvJGAkFfJbPgA yA9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=8O0GmLmMoRmEaJeluQ/XscfsR0TfkwYHSxik941VaGI=; b=vH4WvvQ3RpEWz4T3l8Q9/2nAuln23BA1g29DjZRC71dN4+A+WVuRhO499hxu7DBBQK f7/x1tWVunzRAw3zmpNGtHLVWiEEZtbT4aes0U/1wh8k1s+V8uRguNwz7c0Rcb4Vwfm/ 3UXeNj/4PzM8aloSC/FSTjjL0Y5bAALtJiDql1cg+OQsCaE4uKWlVI0AIQu5ZH6olyVM 9WTA24d2KisS97CmmiNFlJGtzPReyRJoOuGDK0Ant7LWZa8v4Mc6nOLMO95UP/MlHv7n M+4buZJRsbDDkO6E5LBdD6NFgmZfACRLmWwS6Z5zQvsSxxpb99U2WwG27DvAwJeSeCe5 dmUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g20-v6si1133234pgb.239.2018.07.17.08.53.51; Tue, 17 Jul 2018 08:54:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730054AbeGQQ0V (ORCPT + 99 others); Tue, 17 Jul 2018 12:26:21 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:53362 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729687AbeGQQ0V (ORCPT ); Tue, 17 Jul 2018 12:26:21 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ffSHX-00015d-88; Tue, 17 Jul 2018 15:52:55 +0000 From: Colin King To: "David S . Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ipv6: sr: fix useless rol32 call on hash Date: Tue, 17 Jul 2018 16:52:54 +0100 Message-Id: <20180717155254.30367-1-colin.king@canonical.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The rol32 call is currently rotating hash but the rol'd value is being discarded. I believe the current code is incorrect and hash should be assigned the rotated value returned from rol32. Detected by CoverityScan, CID#1468411 ("Useless call") Fixes: b5facfdba14c ("ipv6: sr: Compute flowlabel for outer IPv6 header of seg6 encap mode") Signed-off-by: Colin Ian King --- net/ipv6/seg6_iptunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c index 19ccf0dc996c..a8854dd3e9c5 100644 --- a/net/ipv6/seg6_iptunnel.c +++ b/net/ipv6/seg6_iptunnel.c @@ -101,7 +101,7 @@ static __be32 seg6_make_flowlabel(struct net *net, struct sk_buff *skb, if (do_flowlabel > 0) { hash = skb_get_hash(skb); - rol32(hash, 16); + hash = rol32(hash, 16); flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK; } else if (!do_flowlabel && skb->protocol == htons(ETH_P_IPV6)) { flowlabel = ip6_flowlabel(inner_hdr); -- 2.17.1