From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benny Halevy Subject: [PATCH] fix warning in audit_match_perm Date: Wed, 20 Aug 2008 14:18:09 +0300 Message-ID: <48ABFD71.6070702@panasas.com> References: <4892F063.1080109@cn.fujitsu.com> <4893C42A.60803@cn.fujitsu.com> <4893CBA9.9020008@cn.fujitsu.com> <4893CCE5.7020907@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <4893CCE5.7020907@cn.fujitsu.com> Sender: linux-kernel-owner@vger.kernel.org To: Linux Audit Cc: zhangxiliang , Eric Paris , Steve Grubb , viro@zeniv.linux.org.uk, Linux Kernel Mailing List , Yu Zhiguo List-Id: linux-audit@redhat.com kernel/auditsc.c: In function =E2=80=98audit_match_perm=E2=80=99: kernel/auditsc.c:249: warning: ISO C90 forbids mixed declarations and c= ode This was introduced in commit 1a61c88defcd611bd148d6c960b498e1b8bbbe00 Signed-off-by: Benny Halevy --- kernel/auditsc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 972f8e6..e72b161 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -243,10 +243,12 @@ static inline int open_arg(int flags, int mask) =20 static int audit_match_perm(struct audit_context *ctx, int mask) { + unsigned n; + if (unlikely(!ctx)) return 0; =20 - unsigned n =3D ctx->major; + n =3D ctx->major; switch (audit_classify_syscall(ctx->arch, n)) { case 0: /* native */ if ((mask & AUDIT_PERM_WRITE) && --=20 1.6.0