Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751947AbdGFPux (ORCPT ); Thu, 6 Jul 2017 11:50:53 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55448 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751654AbdGFPuw (ORCPT ); Thu, 6 Jul 2017 11:50:52 -0400 Subject: Re: [PATCH] apparmor: Fix shadowed local variable in unpack_trans_table() To: "Serge E. Hallyn" , Geert Uytterhoeven Cc: James Morris , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org References: <1499331381-32753-1-git-send-email-geert@linux-m68k.org> <20170706134428.GA19254@mail.hallyn.com> From: John Johansen Organization: Canonical Message-ID: Date: Thu, 6 Jul 2017 08:50:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170706134428.GA19254@mail.hallyn.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1662 Lines: 47 On 07/06/2017 06:44 AM, Serge E. Hallyn wrote: > Quoting Geert Uytterhoeven (geert@linux-m68k.org): >> with W=2: >> >> security/apparmor/policy_unpack.c: In function ‘unpack_trans_table’: >> security/apparmor/policy_unpack.c:469: warning: declaration of ‘pos’ shadows a previous local >> security/apparmor/policy_unpack.c:451: warning: shadowed declaration is here >> >> Rename the old "pos" to "saved_pos" to fix this. >> >> Fixes: 5379a3312024a8be ("apparmor: support v7 transition format compatible with label_parse") >> Signed-off-by: Geert Uytterhoeven > > Reviewed-by: Serge Hallyn Acked-by: John Johansen I will pull this into my tree for my next pull request > >> --- >> security/apparmor/policy_unpack.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c >> index c600f4dd1783252a..2d5a1a007b062a73 100644 >> --- a/security/apparmor/policy_unpack.c >> +++ b/security/apparmor/policy_unpack.c >> @@ -448,7 +448,7 @@ static struct aa_dfa *unpack_dfa(struct aa_ext *e) >> */ >> static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile) >> { >> - void *pos = e->pos; >> + void *saved_pos = e->pos; >> >> /* exec table is optional */ >> if (unpack_nameX(e, AA_STRUCT, "xtable")) { >> @@ -511,7 +511,7 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile) >> >> fail: >> aa_free_domain_entries(&profile->file.trans); >> - e->pos = pos; >> + e->pos = saved_pos; >> return 0; >> } >> >> -- >> 2.7.4