From: Gao feng Subject: [PATCH 3/5] audit: use old_lock in audit_set_feature Date: Fri, 1 Nov 2013 19:34:44 +0800 Message-ID: <1383305686-9752-3-git-send-email-gaofeng@cn.fujitsu.com> References: <1383305686-9752-1-git-send-email-gaofeng@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.20]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rA1BXoxr022944 for ; Fri, 1 Nov 2013 07:33:50 -0400 Received: from song.cn.fujitsu.com (cn.fujitsu.com [222.73.24.84] (may be forged)) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA1BXjnI024528 for ; Fri, 1 Nov 2013 07:33:49 -0400 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id rA1BXh6V019873 for ; Fri, 1 Nov 2013 19:33:44 +0800 In-Reply-To: <1383305686-9752-1-git-send-email-gaofeng@cn.fujitsu.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com List-Id: linux-audit@redhat.com we already have old_lock, no need to calculate it again. Acked-by: Eric Paris Signed-off-by: Gao feng --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index c307786..19f21ae 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -697,7 +697,7 @@ static int audit_set_feature(struct sk_buff *skb) old_lock = af.lock & feature; /* are we changing a locked feature? */ - if ((af.lock & feature) && (new_feature != old_feature)) { + if (old_lock && (new_feature != old_feature)) { audit_log_feature_change(i, old_feature, new_feature, old_lock, new_lock, 0); return -EPERM; -- 1.8.3.1