From patchwork Sun Aug 13 17:36:02 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: 9897985 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 85D4D60244 for ; Sun, 13 Aug 2017 17:36:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 688192841D for ; Sun, 13 Aug 2017 17:36:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D0E228622; Sun, 13 Aug 2017 17:36:27 +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 0520D2841D for ; Sun, 13 Aug 2017 17:36:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751103AbdHMRgZ (ORCPT ); Sun, 13 Aug 2017 13:36:25 -0400 Received: from mout.web.de ([212.227.15.3]:54168 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000AbdHMRgY (ORCPT ); Sun, 13 Aug 2017 13:36:24 -0400 Received: from [192.168.1.2] ([92.228.32.17]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M6DjG-1dNdZn3cM6-00y8kZ; Sun, 13 Aug 2017 19:36:06 +0200 To: linux-ima-devel@lists.sourceforge.net, linux-ima-user@lists.sourceforge.net, linux-security-module@vger.kernel.org, Dmitry Kasatkin , James Morris , Mimi Zohar , "Serge E. Hallyn" Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] ima: Delete an error message for a failed memory allocation in ima_add_digest_entry() Message-ID: Date: Sun, 13 Aug 2017 19:36:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:qxBeNEVpeQhKnLDREYsLTKLknkPCTIlc7lfN7bQqD8+tJDEIX0y OLuYf6yoZ14YtBsDAyoaZQsSj8vmuq7B+biLkR0BHxrh3UhMTukjf5LUol/at1zXBROV+Ac qZKKHWWFQObnYsiOSgZKMw3ukqZR9ruzko9LIuZeKJZyLYE41cMUybQeq5tMiupMfWZiCBY dxNWMqqnAkbfSHrYTEl1A== X-UI-Out-Filterresults: notjunk:1; V01:K0:+Zn3eddONIM=:ycElzfdgOFbtJ3i+30Ts/8 1jO4oylaedUVi0mRy4BRiVTlRMWWxteb/5C//TE3oaZ5NJdlZkDH1Ojw7p6ecAE4lisotTb9R PZeH0YqC9SxbkZ5urub8qGvxSW3nfcYlt4kLREOVef1ziiyzi8oiGSFhwQgvnqcLt+t6he4Du u/sGlpDM8EWwnRMKePAYtYv71VbhZNOXQmxVFuyPAPLWNCNucaeKny8OaXbJZuzxtY8JwQd7F FhOrwMPRtEvJjGGgdhvZz6M0CjTiez3VHKY3FaFXNDvG5zcAU7iZWSsDh+8IWrvn1wSmXYpWO fJgNciunugVc5QnKpODi3Bbc0CqVLfh42zflhKukz6rwf1MNZ6Acn6373ZO84kctmEOkgoXfh 3iNZB7kKeAalVlnEMvXcRhWwfOjhnLwVeaZbOhpSSFTUBBbz5znPNBmfyEp4lC4GnX7wFRpxr BWTKAYwiORWEyBmRmR67CstYeVHOQzoqMmh4DJvnwb9kenOByeYyT+F7dZAZXY1eA6vTABhjh kebRtSd5IPYZXKLJ96qguGQYV+Wj/d3EwkdIQ2mMOf+XU9rwGXVErFQcs4L820mr61VFNiuL/ bnGL/Rhsu1jpIWn5HQr6ju5D7J0FQJen0+8EUYronNKMaZtaEjbRpiHUkwhJvj996c6oFy1Ko ZSi9HJ1JnnDJmaeXPaBcQUs8B6X+5hIjvlh2eu09eWjzOCt678mriH2xPxLqEF0V1CWR/nUuP +w5fyXO/ZdIQOWLARzsZX0L4LQJcpiYWy5oQWJzfLLZlSdOKOFlPHXQfL7zH9GYvPh5f0tAAi +WZxUQ3vmNtJcy+gE4gqrHJGaOUeoBTZSEhUQQiW0ia+siG98o= Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 13 Aug 2017 19:29:11 +0200 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- security/integrity/ima/ima_queue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c index a02a86d51102..3b60e72aecb2 100644 --- a/security/integrity/ima/ima_queue.c +++ b/security/integrity/ima/ima_queue.c @@ -100,10 +100,9 @@ static int ima_add_digest_entry(struct ima_template_entry *entry, unsigned int key; qe = kmalloc(sizeof(*qe), GFP_KERNEL); - if (qe == NULL) { - pr_err("OUT OF MEMORY ERROR creating queue entry\n"); + if (!qe) return -ENOMEM; - } + qe->entry = entry; INIT_LIST_HEAD(&qe->later);