From patchwork Sat Jul 14 16:19:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 10524753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D88856028E for ; Sat, 14 Jul 2018 16:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAE5728995 for ; Sat, 14 Jul 2018 16:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD564289AF; Sat, 14 Jul 2018 16:19:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C72128995 for ; Sat, 14 Jul 2018 16:19:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728135AbeGNQio (ORCPT ); Sat, 14 Jul 2018 12:38:44 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:50894 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727086AbeGNQio (ORCPT ); Sat, 14 Jul 2018 12:38:44 -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 1feNGG-0007YB-OD; Sat, 14 Jul 2018 16:19:08 +0000 From: Colin King To: John Johansen , James Morris , "Serge E . Hallyn" , linux-security-module@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] apparmor: remove redundant pointer 'info' Date: Sat, 14 Jul 2018 17:19:05 +0100 Message-Id: <20180714161905.5403-1-colin.king@canonical.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King Pointer 'info' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'info' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King --- security/apparmor/domain.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index 098d546d8253..410d9ce09861 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -1006,7 +1006,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile, const char *name, bool sibling) { struct aa_profile *root, *hat = NULL; - const char *info = NULL; int error = 0; if (sibling && PROFILE_IS_HAT(profile)) { @@ -1014,7 +1013,6 @@ static struct aa_label *build_change_hat(struct aa_profile *profile, } else if (!sibling && !PROFILE_IS_HAT(profile)) { root = aa_get_profile(profile); } else { - info = "conflicting target types"; error = -EPERM; goto audit; } @@ -1025,10 +1023,8 @@ static struct aa_label *build_change_hat(struct aa_profile *profile, if (COMPLAIN_MODE(profile)) { hat = aa_new_null_profile(profile, true, name, GFP_KERNEL); - if (!hat) { - info = "failed null profile create"; + if (!hat) error = -ENOMEM; - } } } aa_put_profile(root);