From patchwork Mon Aug 21 06:54:05 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: 9911641 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 21ECB600C8 for ; Mon, 21 Aug 2017 06:55:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 139BB28722 for ; Mon, 21 Aug 2017 06:55:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06BDB28736; Mon, 21 Aug 2017 06:55:54 +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=unavailable 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 B67B628723 for ; Mon, 21 Aug 2017 06:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751164AbdHUGyT (ORCPT ); Mon, 21 Aug 2017 02:54:19 -0400 Received: from mout.web.de ([212.227.15.4]:54191 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbdHUGyR (ORCPT ); Mon, 21 Aug 2017 02:54:17 -0400 Received: from [192.168.1.2] ([85.182.36.210]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MYNkX-1e64yT2uVV-00V4cD; Mon, 21 Aug 2017 08:54:12 +0200 To: linux-fsdevel@vger.kernel.org, Alexander Viro , Andy Whitcroft , Joe Perches From: SF Markus Elfring Subject: [PATCH] binfmt_flat: Delete two error messages for a failed memory allocation in decompress_exec() Cc: LKML , kernel-janitors@vger.kernel.org Message-ID: Date: Mon, 21 Aug 2017 08:54:05 +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:J2bP+1cijSgW255N5oD97z5EbFGhzmkmxbwLfC9/BafJbiOJgxx k0iUpXEuEKgLB73A7/VM1CNVO7TWMVtrFbOIQimjmpd3W22gsIemB2K1IIaROymoJ//rYKB qAkPoY8+rp2WLUykpNTnefwUHQVXc7z8J8WpLP6KszIg6iTLVrse20pZHyr5BmEVjfJmr/K nnvowktzvBAPkR9biPBow== X-UI-Out-Filterresults: notjunk:1; V01:K0:PiPkovNnHj0=:y8qQQ+YdXtVcbc3BxRz8bx BvmveomH5aRsiI2Mk7B29WfcOzJfGLghLMUiOUi9I7ZTaGl/dzTAEFwBkvTD3odk2pSw78VP5 +II1YMYUSqGlPYOFZ6pm4hBzpsKkgrB8Zf0ajMPrsq9G8UlYIXxWVRT/1xdL8nTXY560qhq/L CkFccYQa3+l4yQMw9klguZTk7tSZQWdZ+dPN8V1J1yQuaO1hk15qXaxWLU6wuWZcIREYGtH5K qUfqYh9VTQdsHusj8ZQefdYe+oC2zQzgsHY5GSFVjXb8WsXfV3cKTv6F1au0Jn/U01zWDxkh4 8+O5oc9L3Z2qQje3ODqWcPV83ZXPCKGXt5DnxzXh1JBkhqsQLI/X9zcJyAaxB4KQSCTrpvYKN rEUDNYvLQc+O018yh0UvpesAbTAWZiyigIdikqXh2abUuH3aburvw6zYhJYygTvx1CD1dXAzK xBO1qpKxDNKlJ0nOfF9xRb10tVCZgyDVGXp5Lh3CIJLTR0CtKoLFzHkcDqg3GlBwrwWnU5tmu HFybAuvPm0Xr/pD+96+I8qdZ6J2Ngg4ArIIi1ktMb6oEh2kCxNUnmbd85N4tmSoSEDZYbCyy/ +X5AKxav0uHO2Q3TzYRdt1nO7HcNRf+CkbD8Pmz+NaIKsvvGEVMgoq3YcDM5e2SOtMXNsZN8R UAn4Tktbcz0w8I5VVj483AACrfOt00g3elK9e7+4r2g/1vnB1JXaMOY9fleBjsCMSu1t5EfKy aMruvzibXeG2KatJF3D53PzzkITgf66fPygezCGZf2nyV43H0vBm2snpHltwQeWCpxFU6v3Gm HwOZ4RU75bixv93FzVAaoBIgD6pp+vf9kQpTZBgAUtJzgPAVBoqn/+bZULCyx+zoNXGzovH Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Mon, 21 Aug 2017 08:43:50 +0200 Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- fs/binfmt_flat.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index 604a176df0c2..ce6537c50ec1 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c @@ -192,13 +192,11 @@ static int decompress_exec( memset(&strm, 0, sizeof(strm)); strm.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); - if (strm.workspace == NULL) { - pr_debug("no memory for decompress workspace\n"); + if (!strm.workspace) return -ENOMEM; - } + buf = kmalloc(LBUFSIZE, GFP_KERNEL); - if (buf == NULL) { - pr_debug("no memory for read buffer\n"); + if (!buf) { retval = -ENOMEM; goto out_free; }