]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
apparmor: Fix shadowed local variable in unpack_trans_table()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 6 Jul 2017 08:56:21 +0000 (10:56 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 5 Sep 2017 12:34:44 +0000 (07:34 -0500)
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 <geert@linux-m68k.org>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 966d631935a578fadb5770f17a957ee1a969d868 linux-next)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
security/apparmor/policy_unpack.c

index c600f4dd1783252a1fc429379cb1cca8b9728c9b..2d5a1a007b062a73f807db6bb81b8b42b79bf44b 100644 (file)
@@ -448,7 +448,7 @@ fail:
  */
 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;
 }