From patchwork Fri Sep 2 14:47:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Lambert X-Patchwork-Id: 9311111 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 F07DA60865 for ; Fri, 2 Sep 2016 14:48:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E36CD297C5 for ; Fri, 2 Sep 2016 14:48:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7434297C8; Fri, 2 Sep 2016 14:48:19 +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 74198297C5 for ; Fri, 2 Sep 2016 14:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754169AbcIBOsO (ORCPT ); Fri, 2 Sep 2016 10:48:14 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33200 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754098AbcIBOr5 (ORCPT ); Fri, 2 Sep 2016 10:47:57 -0400 Received: by mail-wm0-f65.google.com with SMTP id w207so3168392wmw.0; Fri, 02 Sep 2016 07:47:57 -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=y9wi3rxn1uSy08Wtuk9uFE3gJmLfFhXW0HYm0GjMqj4NTmdrC4ZdIs5HRVUyxyfxmD V9FjhlwRnEGjAz+skq7y0v9ZE2akQ7UbbUCC/V4pWRXGgl86qysvfUhtC19m/906ik93 Lewfi3DPg8XXbmtCgMbpztoMyXHRhm/LZL1S21Ty/H05B6I/bppl7QD48HHC/JYisan6 OVgmT7Hf/6ajrsQohzBtVp6wQCwV3s/WiRzEQob0x9B5yokJV6Bsy+WOsZylpep6Jvpd I4bMrOcELd+ArO0O8WClVzZIaakgjnC5L87r4QAh5GKOrih9meA+WaMA3L/NJClP6cNA 2cCg== 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=JoOdrnhZ7NVe3POu9ahLrwNIOPJ8DkV9mdjWuPpc53+PZzPhKHPQ1NAdjddnzsACBC uQdNqaNlhuQBkFE6ZBRVjHVBz1/9JpyTXLXG5ng3g76R+EbVDAicn142aQgmAukBvyZS wcR1+t5WdFby2KKao+QWSRWgByAytR0DOvRZlLmLvY4h/Yts2xQxjMcnftPWErsVI2uH bc6j3oKYdjL1gR+jYf9BQnCCf2bIC2Y2cuYVSWx6F9ydpgWSdx0lCEuISCkKwztjYclO lonWWqidzUvygNcjmJJYwSVFweIQfmAEoZmyPR1A7cdMMj8RNQt4tLo4GqBEmy3V3LfZ um2A== X-Gm-Message-State: AE9vXwNgq8/Aj87XqaNB30a+76x0R6Ks30hvcFYkcYYPmeZFzVQFU+0xZF2S/CAZ6g4nEA== X-Received: by 10.28.229.19 with SMTP id c19mr3810375wmh.0.1472827676193; Fri, 02 Sep 2016 07:47:56 -0700 (PDT) Received: from sloth.lip6.fr (hp-quentin.rsr.lip6.fr. [132.227.76.76]) by smtp.gmail.com with ESMTPSA id bc5sm4188121wjb.37.2016.09.02.07.47.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Sep 2016 07:47:55 -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 v2 2/2] crypto: qat - fix resource release omissions Date: Fri, 2 Sep 2016 16:47:53 +0200 Message-Id: <20160902144753.31334-3-lambert.quentin@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160902144753.31334-1-lambert.quentin@gmail.com> References: <20160902144753.31334-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 ||