From patchwork Tue Aug 17 17:08:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 12441793 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F013DC432BE for ; Tue, 17 Aug 2021 17:08:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C69A460FD9 for ; Tue, 17 Aug 2021 17:08:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231151AbhHQRJS (ORCPT ); Tue, 17 Aug 2021 13:09:18 -0400 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]:56726 "EHLO smtp-relay-canonical-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbhHQRJR (ORCPT ); Tue, 17 Aug 2021 13:09:17 -0400 Received: from localhost (1.general.cking.uk.vpn [10.172.193.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id AD0933F0B9; Tue, 17 Aug 2021 17:08:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1629220122; bh=WJBXkkU1tHc8E8eo8Usv6y0V0Z9Qgiu/DplUySoP91s=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=anFq0wsiYvXoedRMVYYKBJlaFe4IRTL41by7WARaDZFAfL9YofQcSVJTnYkSm7yPu jlqQvHRdJp5OUwIunUOfcSZP5MlZtoRxDpSBwdaMNg4/qgVYMj+ps6366ON/TLxRJf 2foqSWHaPdYwCRpSkSULec1DOkdC3LSZWdtzsoI1oadmEpx1DiEkT1rMUff7G8GO7x RtyvDQrTA796S7rfHD5V1TVJrGDQcsYiUCC2zv5H9cOcRILXdvYpOAUaxxyZXTiQxq EQ0VEaVqXhX8x4ad2IXmkMBWh7zy1i0H0lSd1obaB9V0KQl8FcakBLAaUUU4ivQS6D z5wbV61JPViqg== From: Colin King To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] bpf: remove redundant initialization of variable allow Date: Tue, 17 Aug 2021 18:08:42 +0100 Message-Id: <20210817170842.495440-1-colin.king@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net From: Colin Ian King The variable allow is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- kernel/bpf/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c index a1dedba4c174..9f35928bab0a 100644 --- a/kernel/bpf/cgroup.c +++ b/kernel/bpf/cgroup.c @@ -1133,11 +1133,11 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor, struct bpf_cgroup_dev_ctx ctx = { .access_type = (access << 16) | dev_type, .major = major, .minor = minor, }; - int allow = 1; + int allow; rcu_read_lock(); cgrp = task_dfl_cgroup(current); allow = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[type], &ctx, bpf_prog_run);