Path: csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod From: SF Markus Elfring Newsgroups: linux.kernel Subject: [PATCH] ima: Delete an error message for a failed memory allocation in ima_add_digest_entry() Date: Sun, 13 Aug 2017 19:40:02 +0200 Message-ID: X-Original-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" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit 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: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 31 Organization: linux.* mail to news gateway X-Original-Cc: LKML , kernel-janitors@vger.kernel.org X-Original-Date: Sun, 13 Aug 2017 19:36:02 +0200 X-Original-Message-ID: X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1710573 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); -- 2.14.0