From patchwork Sun May 7 12:02:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9715689 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 A4C0B60364 for ; Mon, 8 May 2017 01:34:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 973F025223 for ; Mon, 8 May 2017 01:34:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B7AB26E5D; Mon, 8 May 2017 01:34:29 +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 4710F25223 for ; Mon, 8 May 2017 01:34:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752120AbdEHBe2 (ORCPT ); Sun, 7 May 2017 21:34:28 -0400 Received: from mout.web.de ([212.227.15.3]:56496 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751676AbdEHBe1 (ORCPT ); Sun, 7 May 2017 21:34:27 -0400 Received: from [192.168.1.3] ([77.182.161.211]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MMmwZ-1d7cPW1fId-008bt4; Sun, 07 May 2017 14:02:09 +0200 Subject: [PATCH 1/2] apparmorfs: Combine two function calls into one in aa_fs_seq_raw_abi_show() From: SF Markus Elfring To: linux-security-module@vger.kernel.org, James Morris , John Johansen , "Serge E. Hallyn" Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Sun, 7 May 2017 14:02:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K0:ehswhkN8iuZmAUcU2hxEjM6O5FIXoFD9yGCz4bt+5hGfnH4azz6 lbAiqZ6xcE534dlnXQxUTENLlwMx4/DYKiGAo4frzSjDCI4Bd7SChvWeMrsov39RXS/MjcG F1+9110KgWW53cUbvNjs/pdb0XDPq5sARdZPBD/RgxDTn20XnxfZGzIlPEDPDTwsAgVoOGl FgWlipMP45bDuWq0hayyA== X-UI-Out-Filterresults: notjunk:1; V01:K0:6Hm4UoH/T3I=:V6P+SjUSiIVsG9NrUJ0jDV b58jfYtW1iSdCtJCLKRM4ivBvETYgeqlE0bOMAEJ7HZHYS8EfGK3m2w2rkgsXCuEYignV3j/8 kawZhry5L9gN/rriAehYKFcrcAysjyapZtMFbIg/9lNaVBqSjaysKfCBKKO4CxNK1aMll+1rp fL0ySL0ETOEKX0te61pL+Tx2cwH/9FQ5DBdNMzLlzhpnHFHMtBoYHpCl0mD7x4Oz0Z2LuT0lB 5AT/1lslk07F07gBxhhC4OTeKX7EokEeTEskXfLbYVA64h8tXhoIROq7sGH/9GWam5QccKkie ltCcD1KCj4aLIp3nAE1JRHzQQuOxkLi2DSwm08EMJb1VHkXpDjvYTd8tnnfkVNcn19HeSVd0W G50TcFvOjwqHq3Lu4TIEhe9B225wjPt8dRaZmsYih53AQcb6n5IDBDwFcbDz9d6Yy4ThrkptF UA9BKWunA/1IQ+IPt9Wy6Hgzu3WQUwoi8ELn0zVkGJhelViRd9sAZrID1QDCsBC7c6kWZYVgZ QT2vz09P8y+3yTuz4h4wvsuC9lWhSsm/f2hMEOaCCjinzmxRd3QKUlYnY24r3PwbJoE3quxAe 9VhbzkhU5/fXctCAXVx/CHuACobjpI3fAawstcB1MPt9WKArdhsxLuoGGZeoDPZHAk08pTkDd oH11SETpkdZ5K6Vu39UxllYoNoI6JgXFLgsZn4B5RHrWB+W8O0BVgHYyonrcN5ixvTaj99JIn lHowLHf1HqEyFJqQ5i+/w3V1xd3DBwDjb+lX2KF0DhS7KDLXjJpjezveRV/0q8iYgdim8Tblh qVNsXlN Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 7 May 2017 13:43:50 +0200 A bit of data was put into a sequence by two separate function calls. Print the same data by a single function call instead. Signed-off-by: Markus Elfring --- security/apparmor/apparmorfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 4f6ac9dbc65d..b4d83e0bc651 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -572,10 +572,9 @@ static int aa_fs_seq_raw_abi_show(struct seq_file *seq, void *v) struct aa_proxy *proxy = seq->private; struct aa_profile *profile = aa_get_profile_rcu(&proxy->profile); - if (profile->rawdata->abi) { - seq_printf(seq, "v%d", profile->rawdata->abi); - seq_puts(seq, "\n"); - } + if (profile->rawdata->abi) + seq_printf(seq, "v%d\n", profile->rawdata->abi); + aa_put_profile(profile); return 0;