Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2068106ybe; Sat, 14 Sep 2019 07:18:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxU2JIbAtcazQxbAGGNQYYulWtma6yXaOacC5lio1iUEoRDVvnR7e8gUEP1IdEyWP/2XQe9 X-Received: by 2002:aa7:c359:: with SMTP id j25mr47679760edr.153.1568470717782; Sat, 14 Sep 2019 07:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568470717; cv=none; d=google.com; s=arc-20160816; b=y/0NQdqYTYj7HrLONd9y7BrISccnzxVURp3Ylo4PoESol9tS2E54spMNKE8jIKSmTa xIXC2cQ01eMxfuBMoTNKALO5vwez9+a3p4eAaJUnsjNDaMDmotqaik69zqAPSTzXsTq/ ARzAzO4fvE28PtXw1abqMLyU673L2ORsQfwP6/Sq5is3LOjsj3+qwf2/a1qbclzRm+Nb ouj+eVXUn4xGd65it2wr3rTt/96ukcrX9zcdHGQPBm1Ktt++i4DUoDcLhOBc8rLrY+SD WJOt3RVzo6iwJe8Pot1aBXP792ahUA0akVGda5JNCO5P0Ds65jxJogXWkMWoj6umPhB2 vr2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature; bh=GM8PB7dX+o/8qn6bAAUtttU+f7SZoyImDe+8xUZo7YE=; b=Wy7YGxcTaI9gC1ZEZEZ2rRbrv1/qkfPOWfT1M5uaaMs+DuS3F7WoftWljdcfEsaygY 9l69DAiGfMfAhAPdEQHwbu97PJhVLxQQ2ruOgEO/6Hy1rh3+OXDODSq5xxL/abTQ433Z Ajpo61ejfujsiJYeBbn2ztpFYD/J6rsEvBmb4a4GawLJ1NkqDMIprTBP60ckvqof2GDp jF6L9M3psQD3levLe2/oH2nGpN5JS3dK1t+mLvOVHqICCtqLDyF/hgEVF3vcLjb+pA1X 4dQzGpml+w/HyWflnJPcKPv0+dCjveKDIxFBrpeTVfdQ36hS1GCk680htMHk1QK8Btx3 wEtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rqL6bhr+; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si16489553edn.318.2019.09.14.07.18.03; Sat, 14 Sep 2019 07:18:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rqL6bhr+; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390606AbfIMXsj (ORCPT + 99 others); Fri, 13 Sep 2019 19:48:39 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45783 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390597AbfIMXsi (ORCPT ); Fri, 13 Sep 2019 19:48:38 -0400 Received: by mail-io1-f68.google.com with SMTP id f12so66282162iog.12; Fri, 13 Sep 2019 16:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GM8PB7dX+o/8qn6bAAUtttU+f7SZoyImDe+8xUZo7YE=; b=rqL6bhr+wZpI82VpkH0lghLYPfFzKW4vpMBu+cKu3dpDnhRTyKkTiZ+rxx2RHFQlpr yHzrOMmqcPVi3Br7ng3sP5MF5dz0U5XL++uzjStYZ5RrmYY89pPcCQgmd/aXPWIJAw3b SAEGanmvh6MEWQDoONuQvOurbv0fqYF6S3jsgtKSs+xIR9TCCbCsa2HNRgU8wvXgAwvW zJN7ulRnCCi13T5n/DCC9uoRvhaGloOkuA5bWhxXAXSfSUgXPG6jV41BSbTm42+JCTPu aDR2I9HKSk6LB+7l4LFELVpiaPhSFRgTsHD2e3RnKUTEYERChCk0Ywj0egzbV1MZmT68 SQ6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GM8PB7dX+o/8qn6bAAUtttU+f7SZoyImDe+8xUZo7YE=; b=U9ksryWF1LtznJEA3z3Nck2ZkK0yftDssgeRP2yPx8CT3e0UtL73s6sci6Zle699VP TWfxIYzPjPSG+sO+K98an4ihuEU0jubGeX+mSG5nbt5XjuIm7bA+eRFE0/BVzmycoFdo Tja0P4ZTxWElqWwc/bsKOjrLx5QFCW+dgaOucRaiXFTeSL2lSwwlZwRR27M6IygXa9Xt IgmddbBVev7S+d53el1D4trVdj5EDxAj8WPAg+9SPuFcd4ZbypA5GIqQPptLu27crgb9 Mf1harAJohZ1ZpwvU5fgz4Zd7ZdxmfovCgOCfl605DlOHlT/zbHKQTm6WVUfZNyNVGWo ZzZQ== X-Gm-Message-State: APjAAAUiUtkAFMHmQfP106c9m/bxVzYTKDZXKji8KptLkcJlcO91KPIT w3IHlZhjYyp3i2QNEShdenQ= X-Received: by 2002:a5e:c107:: with SMTP id v7mr3041743iol.200.1568418516590; Fri, 13 Sep 2019 16:48:36 -0700 (PDT) Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) by smtp.googlemail.com with ESMTPSA id t9sm3944122iop.86.2019.09.13.16.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2019 16:48:36 -0700 (PDT) From: Navid Emamdoost Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, Navid Emamdoost , Tom Lendacky , Gary Hook , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: ccp - release hmac_buf if ccp_run_sha_cmd fails Date: Fri, 13 Sep 2019 18:48:23 -0500 Message-Id: <20190913234824.8521-1-navid.emamdoost@gmail.com> X-Mailer: git-send-email 2.17.1 To: unlisted-recipients:; (no To-header on input) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org In ccp_run_sha_cmd, if the type of sha is invalid, the allocated hmac_buf should be released. Signed-off-by: Navid Emamdoost --- drivers/crypto/ccp/ccp-ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c index 9bc3c62157d7..cff16f0cc15b 100644 --- a/drivers/crypto/ccp/ccp-ops.c +++ b/drivers/crypto/ccp/ccp-ops.c @@ -1782,6 +1782,7 @@ static int ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd) LSB_ITEM_SIZE); break; default: + kfree(hmac_buf); ret = -EINVAL; goto e_ctx; } -- 2.17.1