From patchwork Wed Dec 23 18:10:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7913481 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6730EBEEE5 for ; Wed, 23 Dec 2015 18:10:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A519320397 for ; Wed, 23 Dec 2015 18:10:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3E3120395 for ; Wed, 23 Dec 2015 18:10:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754300AbbLWSKa (ORCPT ); Wed, 23 Dec 2015 13:10:30 -0500 Received: from mout.web.de ([212.227.17.12]:60526 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754231AbbLWSK3 (ORCPT ); Wed, 23 Dec 2015 13:10:29 -0500 Received: from [192.168.1.3] ([78.49.98.159]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LeLSr-1aWpka3fPZ-00q8FZ; Wed, 23 Dec 2015 19:10:18 +0100 Subject: [PATCH 3/5] block-LDM: One function call less in ldm_partition() after error detection To: linux-ntfs-dev@lists.sourceforge.net, linux-block@vger.kernel.org, Jens Axboe , Richard Russon References: <566ABCD9.1060404@users.sourceforge.net> <567A6CDB.4030703@users.sourceforge.net> <567AE1C6.9020108@users.sourceforge.net> Cc: Julia Lawall , LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <567AE389.1030803@users.sourceforge.net> Date: Wed, 23 Dec 2015 19:10:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <567AE1C6.9020108@users.sourceforge.net> X-Provags-ID: V03:K0:cPuZeGuQGz5VG8QSnmPeUp0CRPYEJaJZ+WB4jv+uVt63Gvqu+9d ZoFGV3oe/Q5gzY0AnBDe14X3b9bDMjR6k3mOP+TNdFAG/LW2D/B59N56RTCLlhi3z64edFg 8IqwgkDMoOnE7vLnX+C6aWnAvv3YkfprdS/Y9WBu1Z3btiQPnEwVv616KBSkJp6b/Go0TX0 u6yE3berSbBYJgBJQgxdw== X-UI-Out-Filterresults: notjunk:1; V01:K0:52FSwNol4HY=:d2LvS73DyLokona/WNI6yX 9CuQOxvknEoDlrnxXc1MZSDbiN1F3snaZs9N+zMl2dyZ6MEe3KUJuRDTBzjpCMPeQqIkuaRf9 UsTsbO9pKsPbbnC7nrcLeez7NZlbJsZmr+IYPOKxmp2zblLAip1MCeAyNgzClYrnx7kyPfVap IP2AzU4+ki0MbCUIgOR4F+0dfWe4k2YA4hOZdaxGLXVlSSf0yNuK5JdK/YnC6JLwNMV3eF6Jn IYpqOm+dGJXudVjGUCbRmNkwkt2hICeCOLhfzGQ/ldEO3n29a9Kj6GyjXB+acEwIv5lH7v8cG 2yRKg/BxPEd+LNzlXxvDcV91BxhcnrchX5LUYKHH85NCMvn24wMYeZfPakQ2zgOu2fqR8oXKo +iVDPYhL9gmG904RwGKhRBNPx++v/txbyCY92a9s/MsUw93xpf4v+pzA2X2SVKGvoN3sd2+3/ sii+cO4WgTkwgrnuilaWSGtlAzJgJJdEqGRqHFMFkc2mw/sGHhp4JPA/ZclKu/0OWyj70RSEL n/WHxBKuS4M/lB9Bh5NY85FIzW644WS9EVppQ60VH2TGtHaaS+Rxq14e3XiPNLrdp5MM0rh2Z IPRkuvv59L//IOCnJojig68qyAE40GvsC4mP63bHT/1YAJmZhTMf0isCAElQREytZj6KYNZWS j6AqUsLMYyT45GjgGPJ5wZTxK5watO2u6RZaNzOUWkzksZ8jpZNYgIU/n0QcTTuwcrzhIc55+ OKv+lE0fQCEKpP1LnV8l6iOMS7WlVOWGGVD6Oq/0uyJOxUn+PBMJyUJLsIgwoqpA++ZPjvj20 3Y5nAKo Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 23 Dec 2015 13:32:51 +0100 Let us return directly if a memory allocation failed. Signed-off-by: Markus Elfring --- block/partitions/ldm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/partitions/ldm.c b/block/partitions/ldm.c index 856658a..3118d24 100644 --- a/block/partitions/ldm.c +++ b/block/partitions/ldm.c @@ -1512,7 +1512,7 @@ int ldm_partition(struct parsed_partitions *state) ldb = kmalloc (sizeof (*ldb), GFP_KERNEL); if (!ldb) - goto out; + return -1; /* Parse and check privheads. */ if (!ldm_validate_privheads(state, &ldb->ph))