From patchwork Fri Sep 2 14:43:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Lambert X-Patchwork-Id: 9311105 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 5F26F608A1 for ; Fri, 2 Sep 2016 14:44:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51E6928541 for ; Fri, 2 Sep 2016 14:44:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4647B285C7; Fri, 2 Sep 2016 14:44:47 +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=-5.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 E754B28541 for ; Fri, 2 Sep 2016 14:44:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932382AbcIBOob (ORCPT ); Fri, 2 Sep 2016 10:44:31 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34052 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932308AbcIBOoO (ORCPT ); Fri, 2 Sep 2016 10:44:14 -0400 Received: by mail-wm0-f67.google.com with SMTP id v143so3139223wmv.1; Fri, 02 Sep 2016 07:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WLLAMqVGNIVOeVW+ZeuwR+vbFGB/BbSUm7uhf6yBnSo=; b=aCKKWncK9h8L8678G4jB1ZuEhB0tkOVywa7EQkJIk1jR7gz4MUcg9Gf+AWi/is3AER PgGjK+YoLeE+sVWeOhy+oSj3nPDtfOLltn7DmvxQRrq3wrbzvQ2IDWCjBkrEfLULFPwn gcqpH1LOcTnHi7M2Gm/C8p6ueiTWmiTzxPHfT+ugAiCLqhXICoDDXhrKQAHh4YGJRo/n 4mNzBiyLsdI2rzl/jXoCxUue6Bh29LKH+TNHDE9ygODcfjnHhX3IGB3JpkSUGbVPQArR i0CQeLufs1XjnRlJhjtekRZtBdIpDF1YG2AuaH5IZelW++xmcF654wHHW7EUuI3JkmE7 +kDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WLLAMqVGNIVOeVW+ZeuwR+vbFGB/BbSUm7uhf6yBnSo=; b=FTLftqIBpqZJrZrM7yiKPNuazspPIHq3kYXmNSNoDIvpDcxCdo1SL3vsWkWdLtPWwb hlRjwrSOXwZqAk3ZpQW4wUw43ABSi7AlD+hWm0niS/FDFWmuaoVjqda7waNa0W2pPD/N vfynj2QJ0fprjMbEo5LNJM7Zw9bGq+XmC9W6+SXmCp9jFAr8FC6leRtyM7HxqGspZSUk dDYwq/aJf3lAh07QsZ2gVL7g5eGdebNqYftK4kFyEEl6aT4nWhpLttWV0XnAVzGGoHDL LlXrixbq5Ntt255bRl/b5j5oIZ2fOe66Dd3RJPFcqQNrbiVGwH+ZJQsyVbVH6weDIUpI xZPg== X-Gm-Message-State: AE9vXwOVy+3CktFCalb+ni7Mw4kN6t9ydZz2te5HSBHAEXfhDBHQFTHs9FTSAGSrU2pwFw== X-Received: by 10.28.156.80 with SMTP id f77mr3508278wme.56.1472827452205; Fri, 02 Sep 2016 07:44:12 -0700 (PDT) Received: from sloth.lip6.fr (hp-quentin.rsr.lip6.fr. [132.227.76.76]) by smtp.gmail.com with ESMTPSA id g7sm10813519wjx.10.2016.09.02.07.44.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Sep 2016 07:44:11 -0700 (PDT) From: Quentin Lambert To: Giovanni Cabiddu , Salvatore Benedetto , Herbert Xu , "David S. Miller" , qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, Quentin Lambert Subject: [PATCH 2/2] crypto: qat - fix resource release omissions Date: Fri, 2 Sep 2016 16:43:59 +0200 Message-Id: <20160902144400.31216-3-lambert.quentin@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160902144400.31216-1-lambert.quentin@gmail.com> References: <20160902144400.31216-1-lambert.quentin@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In certain cases qat_uclo_parse_uof_obj used to return with an error code before releasing all resources. This patch add a jump to the appropriate label ensuring that the resources are properly released before returning. This issue was found with Hector. Signed-off-by: Quentin Lambert --- drivers/crypto/qat/qat_common/qat_uclo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/crypto/qat/qat_common/qat_uclo.c +++ b/drivers/crypto/qat/qat_common/qat_uclo.c @@ -981,7 +981,8 @@ static int qat_uclo_parse_uof_obj(struct (PID_MINOR_REV & handle->hal_handle->revision_id); if (qat_uclo_check_uof_compat(obj_handle)) { pr_err("QAT: UOF incompatible\n"); - return -EINVAL; + ret = -EINVAL; + goto out_err; } obj_handle->ustore_phy_size = ICP_QAT_UCLO_MAX_USTORE; if (!obj_handle->obj_hdr->file_buff ||