From patchwork Wed Jan 31 02:00:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 126302 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp272263ljc; Tue, 30 Jan 2018 18:03:48 -0800 (PST) X-Google-Smtp-Source: AH8x225HpI2CpHWqjrxoylGkIA1SYnh8vpQzOXsJn5+vtCyOngAJ9I0+RZ/jCbhqTisWDDXKWkxT X-Received: by 10.101.72.69 with SMTP id i5mr21889858pgs.9.1517364228830; Tue, 30 Jan 2018 18:03:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517364228; cv=none; d=google.com; s=arc-20160816; b=bi5/P+STGLib0MiS8IaIOnH2ohiVnB7KuAxj/8AVvTOE7UjVGCT8nTjC1EX8ACBa3G XTZiwErKl3IDKNEijMqPiMOyuRZ3TEL4n8vZlNeflbTv2cWPiGOAaunl3c8rKLN6bXej 1SgR6RDltRfg8GUWMLno/psJKUxKMwg+zLcaCRZIucSLCyP8H7FIEzHYEWGLmRXtyG5/ ChwXHQACSKDvjt5z4rpdQyn/TRz5W+v0295Fc1LHSNPlMvTSbSjn5YzsacMjD0ar1Yv7 EqL5DNOnD2v0Nh51dXFl1i0M/gxHji6KFMDvWbu93pIZe+0Yz0+DJBARaxPK8oLz8nch Tt3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=uc0nnJoVz4Ozc4VaDT+66vpkrhSa0xuOjchanFlXOq4=; b=utHrudfPDPSNMpcKuOVqcH6qjtu9KhyjBXp9U7z2fktdmoHOZKxbJVLP/OtvP1FtrY 5Ug306kSdl1TLeFwSjmxuG4lq4LhLqOmyrbWbXZ0uEoLviI28U7zg583AVv+ArPYqFBb TXaoHh7HakXfImJ18DNKwAJEhtpbFP2D3SjwS2qk62kHW2NernV8ckdSMWJcBIr5++ST DDZJJZ1A+jtdMMRnHG+fgm8WXnxiEf32rJadAlv5lAmgft4xL4DDANvVJDZKZGAo1Ki0 1DqzosZM+5FOmw167giC1nHG4UjXOWEC+fQ7zKDMfLW8ylahA/XYS+JBQANjfQK4xVl6 P4Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=J/ak7NCs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s77si15628741pfj.128.2018.01.30.18.03.48; Tue, 30 Jan 2018 18:03:48 -0800 (PST) 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=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=J/ak7NCs; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642AbeAaCDr (ORCPT + 1 other); Tue, 30 Jan 2018 21:03:47 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36673 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752877AbeAaCAo (ORCPT ); Tue, 30 Jan 2018 21:00:44 -0500 Received: by mail-wm0-f67.google.com with SMTP id f3so4895032wmc.1 for ; Tue, 30 Jan 2018 18:00:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexus-software-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uc0nnJoVz4Ozc4VaDT+66vpkrhSa0xuOjchanFlXOq4=; b=J/ak7NCsaqnov+MDooLCVxQwLJsnkcJ+IrBvECFfEwt929TizLpoYr0wPnhC0l6zYX sdFsHwf3vL+uEWyzZAy6PaT81OoB2yX53M2Taxw91AxKTf8HEu/nGilk5WKLbRR/WQXs YGC+HZiiFGNZjxKJnuFYqxIdCVtw4roZgTRuECr/SGyW00C+cA973S1I1YtvdSHsFsJO sLlIY2zSIiVSBXT+u95f+ht6NVHQ6XXTNEezmWMP2E11BeMguw5y5tmuAH/rI1pqDLzc 5lBs8OIEla1+xX+XJo9ePm/jMHAt4pJeSxuCKUQW8S3aAPCK70y9A/KZC99BpQzwsOAb qS6A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=uc0nnJoVz4Ozc4VaDT+66vpkrhSa0xuOjchanFlXOq4=; b=sweeRoTAswxjqle7LNEVk5AUvVr3dFx0ZLdBHk7Rd8Ziyb9p4dNr762jp17nz7RwB4 V0mgxl9kdQGvoBEvSCGhbtIq0cA0DctLTuXPI4cNwok6D35sOfWFCFKXkrkYJHl/0jac hrVLhu2yD+Sbe8xk/4IDO/du3u+4cgrZ3ZTlxa6lJoPvUn/QWyMSvdTK0oXuBl9iBGkc 4qq1aR39nuVKgwjLEVuP+6Ub5+LcIfl5Qw83AKU9DvbQdqAQtp4XpAOnAYV7BLmjeW3m iAuFVMekYsvI9D3gP6AoehC9rvqxSdteILRCBLDgMfK7lEW4eOxzH2aF34rD1Z4vCzN2 Dt2A== X-Gm-Message-State: AKwxytdeN3RZ+oF8Se3E6pQSTuXQw97EjDJNqxghQl12tJJfM/LuLbLT ageArToWEXvVLkhCdLJmrzfH6g== X-Received: by 10.80.172.131 with SMTP id x3mr22923578edc.260.1517364043369; Tue, 30 Jan 2018 18:00:43 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id w26sm9030867edw.7.2018.01.30.18.00.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jan 2018 18:00:42 -0800 (PST) From: Bryan O'Donoghue To: horia.geanta@nxp.com, aymen.sghaier@nxp.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: fabio.estevam@nxp.com, peng.fan@nxp.com, davem@davemloft.net, lukas.auer@aisec.fraunhofer.de, rui.silva@linaro.org, ryan.harkin@linaro.org, "# 4 . 12+" , Bryan O'Donoghue Subject: [PATCH v3 1/5] crypto: caam: Fix null dereference at error path Date: Wed, 31 Jan 2018 02:00:36 +0000 Message-Id: <1517364040-27607-2-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517364040-27607-1-git-send-email-pure.logic@nexus-software.ie> References: <1517364040-27607-1-git-send-email-pure.logic@nexus-software.ie> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Rui Miguel Silva caam_remove already removes the debugfs entry, so we need to remove the one immediately before calling caam_remove. This fix a NULL dereference at error paths is caam_probe fail. [bod: changed name prefix to "crypto: caam: Fix .."] [bod: added Fixes tag] Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support") Tested-by: Ryan Harkin Signed-off-by: Rui Miguel Silva Cc: "Horia Geantă" Cc: Aymen Sghaier Cc: Fabio Estevam Cc: Peng Fan Cc: "David S. Miller" Cc: Lukas Auer Cc: # 4.12+ Reviewed-by: Horia Geantă Signed-off-by: Bryan O'Donoghue --- drivers/crypto/caam/ctrl.c | 3 --- 1 file changed, 3 deletions(-) -- 2.7.4 diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 027e121..98986d3 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -809,9 +809,6 @@ static int caam_probe(struct platform_device *pdev) return 0; caam_remove: -#ifdef CONFIG_DEBUG_FS - debugfs_remove_recursive(ctrlpriv->dfs_root); -#endif caam_remove(pdev); return ret;