From patchwork Wed Sep 28 15:45:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9355845 X-Patchwork-Delegate: snitzer@redhat.com 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 1DE7A608A0 for ; Thu, 29 Sep 2016 07:58:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 108A72988E for ; Thu, 29 Sep 2016 07:58:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0551F2989A; Thu, 29 Sep 2016 07:58:23 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B99A2989F for ; Thu, 29 Sep 2016 07:58:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8T7uHu5041459; Thu, 29 Sep 2016 03:56:17 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u8SFjEGJ024355 for ; Wed, 28 Sep 2016 11:45:14 -0400 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8SFjEKw028464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 28 Sep 2016 11:45:14 -0400 Received: from mout.web.de (mout.web.de [212.227.17.11]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AA24C04D2EC; Wed, 28 Sep 2016 15:45:13 +0000 (UTC) Received: from [192.168.1.2] ([78.48.47.99]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MMmt1-1brlt33mYx-008b7I; Wed, 28 Sep 2016 17:45:11 +0200 To: dm-devel@redhat.com, linux-raid@vger.kernel.org, Alasdair Kergon , Mike Snitzer , Shaohua Li References: <566ABCD9.1060404@users.sourceforge.net> <7c232017-e291-fd2d-5516-26e5150d90df@users.sourceforge.net> From: SF Markus Elfring Message-ID: <717a9850-4dcf-d6b3-838e-a84f91ac8e7d@users.sourceforge.net> Date: Wed, 28 Sep 2016 17:45:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <7c232017-e291-fd2d-5516-26e5150d90df@users.sourceforge.net> X-Provags-ID: V03:K0:7aq71C9jwBQKyi7Baa8If7zRQa5aaEK7xKu0FIqwyWr1GMZSe1N VvLyRTzLCEkVJOaR/LGeWYEk94qBr6eaItxVL/qWsqJUP8VYp1p8+lxhSsfqOJWZDRaadJ/ 5avJHSPiLlAVHOvSL3unKTPisAMjqIPwpnQg5BbCt/DUmrJExnR/v72XRfYQ4LYHaDSv1oy ePKoQS2LWjEcwD8dKcP5A== X-UI-Out-Filterresults: notjunk:1; V01:K0:Df7Lv3qZ6yA=:tauCufT2bGSmVMWzRn6OtI /ARHdcCd+hXXlt2CgI7vuGz5eSP02Yy9j8+Ei9VbVujzVNZVSkXBQBJjyRxa4Z4hLOgZygC4u JWMAVRiYazvqVIH2jOZVlGQ5Yx1Xtg1TRjaUP61C4K2DPSanHV2EOxvlJGJlHlll/e8ahSIgQ oZvzE7uTDM/y57wm3gnM7alOodsU3fal7isBucGGGHWMuqciv3W78djseMQwFJQPle4xjc69d DyMB+3Uis7LZUvDA5czGdjQ3GZIw2ou0/rJkWbnGBwKSuParW5QUJXV23vypoJnFELSG4HZPi Dj5oPDDx3HCq/A48teKA8ZCGsCCzKeaX/h+u1d3sgoIExa2PQpXgEJMYHRE2pPCPL+ZJZZQIN Da/4vnafMo+KldW4HGbtE6snL3xbOGKQqzP4si5Oyt6XxPaJ6S6svSqgWgdsgZ+4cuAYqhddU HT6jTqeLqrqfPuIcIkeq12pjHmiPZ7bd7B4e0QLep8NJvqvRSKuMLnw+mRGL9RuNgKyzXWQpo kOK5X9+nHx+tZsNDTn6WFSfbGNcaStTWEjWf7nnS9eBI+wc8VaafLpibONIbOSaY1nblDKypZ X/8A/XrIhjFrgeEoNwmTukJqL3zsHqppJE2s5cBIWDG0yNkI6H/669qCBj6boEn5R9mOIlQKI nebBes5JHS4gxsRfsVXPwOL8Zp8ky6uMjy9UzBr+7qkujkHZwOxveEnCHTAo2NT/5wKaFc4HP r95pcpNrkWyGyGpELcU8QkEijXeLtS5eRY2f5MoUVh6sGpcRj/EpVlkvBr4RRdqI3Ob+pPVgx 2CZARAy X-Greylist: Sender IP whitelisted by DNSRBL, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 28 Sep 2016 15:45:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 28 Sep 2016 15:45:14 +0000 (UTC) for IP:'212.227.17.11' DOMAIN:'mout.web.de' HELO:'mout.web.de' FROM:'elfring@users.sourceforge.net' RCPT:'' X-RedHat-Spam-Score: 0.079 (BAYES_50, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 212.227.17.11 mout.web.de 212.227.17.11 mout.web.de X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 29 Sep 2016 03:54:16 -0400 Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML Subject: [dm-devel] [PATCH 08/10] md/dm-crypt: Return directly after a failed crypto_alloc_ahash() in crypt_iv_essiv_ctr() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 28 Sep 2016 15:55:47 +0200 Return directly after a call of the function "crypto_alloc_ahash" failed here. Signed-off-by: Markus Elfring --- drivers/md/dm-crypt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index c457b5e..47f6265 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -375,8 +375,7 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti, hash_tfm = crypto_alloc_ahash(opts, 0, CRYPTO_ALG_ASYNC); if (IS_ERR(hash_tfm)) { ti->error = "Error initializing ESSIV hash"; - err = PTR_ERR(hash_tfm); - goto bad; + return PTR_ERR(hash_tfm); } salt = kzalloc(crypto_ahash_digestsize(hash_tfm), GFP_KERNEL);