Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754536AbbLWSKb (ORCPT ); Wed, 23 Dec 2015 13:10:31 -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 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> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 941 Lines: 31 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)) -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/