From patchwork Thu Mar 31 17:33:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Orzel X-Patchwork-Id: 12797488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83883C433EF for ; Thu, 31 Mar 2022 17:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231419AbiCaRgR (ORCPT ); Thu, 31 Mar 2022 13:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231389AbiCaRgR (ORCPT ); Thu, 31 Mar 2022 13:36:17 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 113C460CC9; Thu, 31 Mar 2022 10:34:29 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id o16so737584ljp.4; Thu, 31 Mar 2022 10:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tYr4+A2I2sUXVhAjEZBjGiVViPde2R3/QXl/MeRC92k=; b=nFEALaQDRJK+KYEsH461dOhzve4fxNfkmMgo2fIBhtDhWjGq0/3pAHjjbmI72dHdKd E57CD6qP4N+xshQ6kiTp0V++2vdUEE6yPY+Lwfte6OlmKHuxAP0q4xR8onHZKKbRjnyP 1X4KLDGOxDAYU8dswNf3x1cXwqYWocH9gPc1Hvgl1js90EDGvkt97oi23edz7BpbetBc sBWMo38844VINbgHx5UjWdVta1PoZujZiteBXWSTNYc/+tZW4hFV21oX9M56nu4AhLrX ZrAsBxU+N+9XQcFK+nJ8pFa0AIAxNdNlpljSex+gsfl34KTktL8AqKESMI4eXWvY9WEv /vdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tYr4+A2I2sUXVhAjEZBjGiVViPde2R3/QXl/MeRC92k=; b=urf3vcc8Ad+Mky+G1N4IF2msOYIup0M7R6SNKl668Jl1fp9PmlJqmApcw52JpQfoSm JwCQc4sJFvNjpLKZ72DCx/1Nu4Rkh7yXySJJkwLf415lx+GGBcANjEfecRxROlFflBdc fuOfs6RMTSfL93TZ4CYS9ggfxIybGtnMoOPWq4KDV1pAG3jNNVnkUl3xxQ0RHmLGzsd+ aXuGMdjm3ac+1tYq0ixMpNm8R3HJ7paXTlbEDBTC69/hAVSVuW/ahlsaBz9FH7/pTy9i uzWWBIffFtniOMBd8NKnmIkTsq0THotYhdSff4/KOwmfjlL5INf7ijOiOiuGApelX1PX 70Bg== X-Gm-Message-State: AOAM533z8cvoxfwywriNtVV6O7SskMMNtyAnkgEiFgWG+6bvGF0Oh+wA 13eeoJrvHuOCNOPTSrDdzgc= X-Google-Smtp-Source: ABdhPJzWR7AdVufxiLU93gc6byk6FCl+NoBdPVzob1NRulTJGAMUnxBz1CXzXgQEFQo/gHGjPZU+cg== X-Received: by 2002:a2e:9003:0:b0:24a:c3a5:849c with SMTP id h3-20020a2e9003000000b0024ac3a5849cmr11159595ljg.68.1648748061620; Thu, 31 Mar 2022 10:34:21 -0700 (PDT) Received: from morzel-asus.lan (static-91-225-135-18.devs.futuro.pl. [91.225.135.18]) by smtp.gmail.com with ESMTPSA id bd10-20020a05651c168a00b00247fe29d83csm2746992ljb.73.2022.03.31.10.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 10:34:21 -0700 (PDT) From: Michal Orzel To: John Johansen , James Morris , "Serge E. Hallyn" , Nathan Chancellor , Nick Desaulniers Cc: Michal Orzel , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 1/5] apparmor: Remove redundant assignments Date: Thu, 31 Mar 2022 19:33:54 +0200 Message-Id: <20220331173358.40939-1-michalorzel.eng@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: Get rid of redundant assignments which end up in values not being read either because they are overwritten or the function ends. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel --- security/apparmor/domain.c | 3 +-- security/apparmor/label.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index a29e69d2c300..77724acd9d8a 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -627,7 +627,6 @@ static struct aa_label *profile_transition(struct aa_profile *profile, { struct aa_label *new = NULL; const char *info = NULL, *name = NULL, *target = NULL; - unsigned int state = profile->file.start; struct aa_perms perms = {}; bool nonewprivs = false; int error = 0; @@ -661,7 +660,7 @@ static struct aa_label *profile_transition(struct aa_profile *profile, } /* find exec permissions for name */ - state = aa_str_perms(profile->file.dfa, state, name, cond, &perms); + aa_str_perms(profile->file.dfa, profile->file.start, name, cond, &perms); if (perms.allow & MAY_EXEC) { /* exec permission determine how to transition */ new = x_to_label(profile, bprm, name, perms.xindex, &target, diff --git a/security/apparmor/label.c b/security/apparmor/label.c index 0b0265da1926..ce9ae9b6b303 100644 --- a/security/apparmor/label.c +++ b/security/apparmor/label.c @@ -807,7 +807,7 @@ bool aa_label_replace(struct aa_label *old, struct aa_label *new) struct aa_labelset *ls = labels_set(old); write_lock_irqsave(&ls->lock, flags); - res = __label_remove(old, new); + __label_remove(old, new); if (labels_ns(old) != labels_ns(new)) { write_unlock_irqrestore(&ls->lock, flags); ls = labels_set(new); From patchwork Thu Mar 31 17:33:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Orzel X-Patchwork-Id: 12797489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B16FCC433FE for ; Thu, 31 Mar 2022 17:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231501AbiCaRg0 (ORCPT ); Thu, 31 Mar 2022 13:36:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbiCaRgV (ORCPT ); Thu, 31 Mar 2022 13:36:21 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51D4C60CF3; Thu, 31 Mar 2022 10:34:32 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id p10so371809lfa.12; Thu, 31 Mar 2022 10:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OpzNliID3SJF8mkL/R1m7B3GbTTnCU3xmaYQk4hdJxg=; b=Pl95tPuGINI7Ed7WbqIptzsgtmRRQbUsGEtp9dMBKwEBSIwDIove4HWr5DpFu7vfXx oO2YFuze6ZGyVwAu2qcJ9fgrnv2zisG/87YCdBNaIiK0mIgvpJOvLxDReMSMWERJJGk5 WwUk0GZdC75yn3t3TLAZn7qLQQ+ezDcmwD2Mk/FsMad7E8+DggD/NcDyIuszN00SmtWy 5fcEGwsArRcMK00cwXnN9L/uY5KzUkBj5EF3WWw0jCK+HEuNabBOUJ7tru2XnGblfUUE Qw++XWD0i0qhhwsvzDQ/f2RNM9JxsvkZUIOjYFNCppPnNF90Ofgj5RC/wJW+phKS6NNJ lAXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OpzNliID3SJF8mkL/R1m7B3GbTTnCU3xmaYQk4hdJxg=; b=smuP6UeZgQHaqn+QqDVuLI9zgcTEiglSgpSpViEi+ppt6EGTYWar23lmAtfQA3qsct UlSzKJPUt3TdeUyFa5OUlkkOMD1LbH/6q99ZPUoj7s0h7RmTeTSLNBvGhsg7DZ3uIMAO Bezj5DXh1GDGTnF1k4Btqp6EI5Q0WXLcvb/GquJhqKw4G1AiZsxMYH5i8aFVnw+ZW+9o CdzTWDYQy9QsXvavMvqIYkwiwD2y4kQF0vehaehJ2wTwgcYxCLP/Ph+iap8nIJK0GmWK OdDafy1T7exAJqXFHcpJqWlKDDss6Hy7ZVnzelbtJCBAcf210Mdl0neWuKHMAOJ5I6wb Hhhg== X-Gm-Message-State: AOAM5325IgqUZvQx3ixBpjrWj/K/odDRONbMgmW6qjAI1/Fcyzh1o4bL vAc5qNo2Oq7ctBzxVLltoFU= X-Google-Smtp-Source: ABdhPJwvcR9wHiqOmhQFqud1XOa3bbZXUQW8k2EYkMf0A9J27rV9+c1UMmS4a0LkEtiixFx9fssazw== X-Received: by 2002:a05:6512:3082:b0:44a:6dc3:3 with SMTP id z2-20020a056512308200b0044a6dc30003mr11237952lfd.663.1648748067209; Thu, 31 Mar 2022 10:34:27 -0700 (PDT) Received: from morzel-asus.lan (static-91-225-135-18.devs.futuro.pl. [91.225.135.18]) by smtp.gmail.com with ESMTPSA id bd10-20020a05651c168a00b00247fe29d83csm2746992ljb.73.2022.03.31.10.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 10:34:26 -0700 (PDT) From: Michal Orzel To: Mimi Zohar , Dmitry Kasatkin , James Morris , "Serge E. Hallyn" , Nathan Chancellor , Nick Desaulniers Cc: Michal Orzel , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 2/5] integrity: Remove redundant assignments Date: Thu, 31 Mar 2022 19:33:55 +0200 Message-Id: <20220331173358.40939-2-michalorzel.eng@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220331173358.40939-1-michalorzel.eng@gmail.com> References: <20220331173358.40939-1-michalorzel.eng@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: Get rid of redundant assignments which end up in values not being read either because they are overwritten or the function ends. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel --- security/integrity/ima/ima_main.c | 2 +- security/integrity/ima/ima_modsig.c | 2 +- security/integrity/ima/ima_policy.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 3d3f8c5c502b..1aebf63ad7a6 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -432,7 +432,7 @@ int ima_file_mmap(struct file *file, unsigned long prot) int ima_file_mprotect(struct vm_area_struct *vma, unsigned long prot) { struct ima_template_desc *template = NULL; - struct file *file = vma->vm_file; + struct file *file; char filename[NAME_MAX]; char *pathbuf = NULL; const char *pathname = NULL; diff --git a/security/integrity/ima/ima_modsig.c b/security/integrity/ima/ima_modsig.c index fb25723c65bc..2c9d451d6326 100644 --- a/security/integrity/ima/ima_modsig.c +++ b/security/integrity/ima/ima_modsig.c @@ -109,7 +109,7 @@ void ima_collect_modsig(struct modsig *modsig, const void *buf, loff_t size) return; /* Ask the PKCS7 code to calculate the file hash. */ - rc = pkcs7_get_digest(modsig->pkcs7_msg, &modsig->digest, + pkcs7_get_digest(modsig->pkcs7_msg, &modsig->digest, &modsig->digest_size, &modsig->hash_algo); } diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index eea6e92500b8..c328c2266092 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -869,7 +869,7 @@ static int __init ima_init_arch_policy(void) char rule[255]; int result; - result = strscpy(rule, *rules, sizeof(rule)); + strscpy(rule, *rules, sizeof(rule)); INIT_LIST_HEAD(&arch_policy_entry[i].list); result = ima_parse_rule(rule, &arch_policy_entry[i]); From patchwork Thu Mar 31 17:33:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Orzel X-Patchwork-Id: 12797490 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C660C433EF for ; Thu, 31 Mar 2022 17:34:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231810AbiCaRgi (ORCPT ); Thu, 31 Mar 2022 13:36:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbiCaRg3 (ORCPT ); Thu, 31 Mar 2022 13:36:29 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4228161A38; Thu, 31 Mar 2022 10:34:38 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id c15so702049ljr.9; Thu, 31 Mar 2022 10:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7qM824sS6qaLgSDzZBkMu0728+GM94bEbKxid0FDaSw=; b=ans9cQPDD/Bcxy8c6SvWao1RjIHo6wajUKKZOpjeeOnhiAnXXssLYPDwf/e3M9D5Mq Bo69mhH6rhiRYVtrNQV7Lst9UewuihSsjNJe5anLqbcSAGftyWr2LT6h9qVV1nzXz68K 0QUZ7jfJaldu9N6lMlaTTtYfubkesA9xLlif0NSWBnFzdLFbmtD7Y4oejabNNRkcL+IM t2uORsApDGoVOz+FxcoF7xQkgJVFZvBtPLLTG7bPZwvfblT1U1zdbd20sUHZrSyO1554 aBexCtyS5lKBelKrZ/MPGcbOT9IR4isXNC+au+aFJMfCFTutn4uw8kr8i/dxYkffZC7G bXyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7qM824sS6qaLgSDzZBkMu0728+GM94bEbKxid0FDaSw=; b=HpJGEINr25JzUNi2cMnlC6dQYuonRQ75+vaN5SvV7V2aqVytG0Q8nIgap3J7XAB82w E1Rak/ZghE6fglQ8TzeseqTNEQEN8GR378lH2MGfoXaqb9qpThiiHIVo3E338UqNhZlI 7wqmu3m+XyrsmRrFuqftywqtT0zSrO1xPwxC+o8LCjQkLV1AAwYWUabL432d2RMino8a lXx6wKMxQzLEgx5nldScWrmyMKjXBdbifJWx906dkIQ3EmLqm502H/3+IVXwMd4pdwfl IdAL/WP8y3DF+17zq4/gqocVxmf1Xiv6tVIJKeyT3fr9u/RDPzLmMl9Kin+EDNCZmqSy S/Hg== X-Gm-Message-State: AOAM5318ePYAGSj8RuICogd65p0nAi1MD++9cD2Gvt0WJ6tyDk3wX65/ vzEsfLfN1OfOC6Aoqv3KaX0= X-Google-Smtp-Source: ABdhPJzT+D0LszikZlweoZjrGWaHhUe+vXIeV9Rkh43UlrBK+TBFxLpNPv92lCgOKGYSvZduQJEDdA== X-Received: by 2002:a2e:8189:0:b0:249:7d3a:ceb0 with SMTP id e9-20020a2e8189000000b002497d3aceb0mr10387568ljg.367.1648748073357; Thu, 31 Mar 2022 10:34:33 -0700 (PDT) Received: from morzel-asus.lan (static-91-225-135-18.devs.futuro.pl. [91.225.135.18]) by smtp.gmail.com with ESMTPSA id bd10-20020a05651c168a00b00247fe29d83csm2746992ljb.73.2022.03.31.10.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 10:34:33 -0700 (PDT) From: Michal Orzel To: David Howells , Jarkko Sakkinen , James Morris , "Serge E. Hallyn" , Nathan Chancellor , Nick Desaulniers Cc: Michal Orzel , keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 3/5] keys: Remove redundant assignments Date: Thu, 31 Mar 2022 19:33:56 +0200 Message-Id: <20220331173358.40939-3-michalorzel.eng@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220331173358.40939-1-michalorzel.eng@gmail.com> References: <20220331173358.40939-1-michalorzel.eng@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: Get rid of redundant assignments which end up in values not being read either because they are overwritten or the function ends. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel Acked-by: Jarkko Sakkinen --- security/keys/process_keys.c | 1 - security/keys/request_key.c | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c index b5d5333ab330..8bdd6410f79a 100644 --- a/security/keys/process_keys.c +++ b/security/keys/process_keys.c @@ -92,7 +92,6 @@ int look_up_user_keyrings(struct key **_user_keyring, return PTR_ERR(reg_keyring); down_write(&user_ns->keyring_sem); - ret = 0; /* Get the user keyring. Note that there may be one in existence * already as it may have been pinned by a session, but the user_struct diff --git a/security/keys/request_key.c b/security/keys/request_key.c index 2da4404276f0..ad29023c9518 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c @@ -116,7 +116,7 @@ static int call_sbin_request_key(struct key *authkey, void *aux) { static char const request_key[] = "/sbin/request-key"; struct request_key_auth *rka = get_request_key_auth(authkey); - const struct cred *cred = current_cred(); + const struct cred *cred; key_serial_t prkey, sskey; struct key *key = rka->target_key, *keyring, *session, *user_session; char *argv[9], *envp[3], uid_str[12], gid_str[12]; @@ -506,9 +506,7 @@ static struct key *construct_key_and_link(struct keyring_search_context *ctx, kdebug("cons failed"); goto construction_failed; } - } else if (ret == -EINPROGRESS) { - ret = 0; - } else { + } else if (ret != -EINPROGRESS) { goto error_put_dest_keyring; } From patchwork Thu Mar 31 17:33:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Orzel X-Patchwork-Id: 12797491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EBD6C433FE for ; Thu, 31 Mar 2022 17:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231848AbiCaRgo (ORCPT ); Thu, 31 Mar 2022 13:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231788AbiCaRgi (ORCPT ); Thu, 31 Mar 2022 13:36:38 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B75286212A; Thu, 31 Mar 2022 10:34:45 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id c15so702461ljr.9; Thu, 31 Mar 2022 10:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O2yUjqyfP6+h+Mes/kvWfMJGMKSWOnhuqw368qWMi+A=; b=KtCpp8D//XHdYHlTlc/9tVmnBQuT0b8Nsp16rK9T7MsX/94S/9FjQvlz8ChWz35cLW e+9yYcmeao2VYcJHb1EhNJ2xjYbA5TpiOCR9QoKq+FY+sR8HwWpmJExLQxCBCJXkvBMK Dxc/ZUx2t9dPIkedXA1H8FkwQMx0ncZYGwY8JTirazwscEjRV9pFe3f1+H0vWGSzXUK7 qo0L2hVtppzk/tjzlxwmxhdhXHr9eVXtOLFZKlo2BFEtF3aqqUuQgdqCVEiuZf3tPux/ z/TUDvSiIr1hynrWg2LM+vyI8EKSLgFJjmUQ0lNtTS2t+guNX06kO4z7w+XR6K/wQSq3 h/wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O2yUjqyfP6+h+Mes/kvWfMJGMKSWOnhuqw368qWMi+A=; b=0hRdtMuXSeHbjUfMZma8KTs7XK5DvgyXBS8HPGQmK+SgjrP8c6q6l33x+WF/QioXsH b4bidjxQreXCrxFJCS5dfbheQ/sK1+O3OHkv3zDluNVEfgDFGwkb90FLw6V31reyBpS/ YdkTIGaoCwIsVrtyIyp5+t03daQehkCBs6Mua61RRfeIX+gi9h/5jpNmKCj+Gn+N8LJ2 9sRk8naKttrY1PsIjq+AoH5pTKFAZPORLu/3pmzb61ENjDW/vWau+04mzBiKF3sfDGpH DrN3TzRcxQbbPFt1Cfd5Pq6jfFmPfJBqjHnyGDpQruO/SsvsyjrYBPjrnF2YnpqIxwlq 6r6w== X-Gm-Message-State: AOAM5325oxd4mkXPYiax1ThogQyOFcF9ix/dFc/cEEN2M/bGVMzghMq8 vh0aw3GT7c0DO0CpZ5NC6/g= X-Google-Smtp-Source: ABdhPJwYonmMN1vUChjs1jBBB/Dd7M1us26z7440MKCuJVGcRWRU7iJmG1lNC0cu0ITx+Nn7h29YJg== X-Received: by 2002:a2e:bf22:0:b0:247:da0b:e091 with SMTP id c34-20020a2ebf22000000b00247da0be091mr11141258ljr.489.1648748080313; Thu, 31 Mar 2022 10:34:40 -0700 (PDT) Received: from morzel-asus.lan (static-91-225-135-18.devs.futuro.pl. [91.225.135.18]) by smtp.gmail.com with ESMTPSA id bd10-20020a05651c168a00b00247fe29d83csm2746992ljb.73.2022.03.31.10.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 10:34:40 -0700 (PDT) From: Michal Orzel To: Casey Schaufler , James Morris , "Serge E. Hallyn" , Nathan Chancellor , Nick Desaulniers Cc: Michal Orzel , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 5/5] smack: Remove redundant assignments Date: Thu, 31 Mar 2022 19:33:58 +0200 Message-Id: <20220331173358.40939-5-michalorzel.eng@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220331173358.40939-1-michalorzel.eng@gmail.com> References: <20220331173358.40939-1-michalorzel.eng@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: Get rid of redundant assignments which end up in values not being read either because they are overwritten or the function ends. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel --- security/smack/smackfs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 658eab05599e..9e61014073cc 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -1192,7 +1192,6 @@ static ssize_t smk_write_net4addr(struct file *file, const char __user *buf, rc = -EINVAL; goto free_out; } - m = BEBITS; masks = 32; } if (masks > BEBITS) {