Received: by 10.223.176.46 with SMTP id f43csp848587wra; Wed, 24 Jan 2018 06:53:56 -0800 (PST) X-Google-Smtp-Source: AH8x225/kuv5xqENsqnjRZ3XyNiF3Em6qOYtQvFzaQ5mX1Men5eRc43/1iDzDXTSixT2lYMmbV+Y X-Received: by 10.98.217.135 with SMTP id b7mr13023716pfl.239.1516805636129; Wed, 24 Jan 2018 06:53:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516805636; cv=none; d=google.com; s=arc-20160816; b=qdIU0CjmfxY4nlePP2Ogsp0Cs8/aAL12T8LdI7YxVxE94KoFCi5c42TGDn/fHuUKsw j7kmxX+o0s/m17FHpbWyycak7v+HHMK/ALLxXKzGDKVmvh2NCi+Y6DOwPOnuhnnZktdi cWmRGc3BsuVSpoJmcvCpXmuYbGQFDHuhfSJ84qrKZqkl+3F38T/HX6DvTTptmxdO9I/V wVfjjwOhRwe8EtHexShelGKUPTrlOn9t51x7T36rp5XeXwwde/lIqpW6BpmLC+JM65X9 fBRdtKwp9+aGSopSAgNgi0+8JmHWqKtU/Kl8+4cjQS4IHf8O4POJ1hTyOtFrmJLibMFT Cv8g== 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=HkGGJTsHUc89HP3kRxlzB2M/21arjc2B8snExWmAhyQ=; b=AwIG+TnOLqDOXaNu7BCh7EUESMbRA43VyDcnp+e9XhlCxapwzNyCt0pShbqZH9g1e4 QEBU9Ql1CciU/nIVY4rCAzW8cnkW+9uMZqgsj8yH92EVRWhEX2MB56z5Pi9yvLSfD881 xrnlhXJk/bD6+l2dPwVz57WtZ/1LKdNbSF4DaZ2AsmpWEkr0XVYWjtXEAAcn/yrWvXPj Ep2nxJoWgteN3P//f1qK5VHPyzNtpZ8LBuDlfoiAcZfd/8539VMeO0oqV5ACK9wbreUC ZCRfCcM0XyetbOnUlgh60/weuTS3XiN7Aw8V6tw+O4cDlDoii5c6jpH2PG/j8Qb3ltHw XFNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=gpomvId0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 v85si3001736pfi.326.2018.01.24.06.53.42; Wed, 24 Jan 2018 06:53:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=gpomvId0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934081AbeAXOup (ORCPT + 99 others); Wed, 24 Jan 2018 09:50:45 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:42590 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934063AbeAXOun (ORCPT ); Wed, 24 Jan 2018 09:50:43 -0500 Received: by mail-wm0-f67.google.com with SMTP id r71so9037754wmd.1 for ; Wed, 24 Jan 2018 06:50:42 -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=HkGGJTsHUc89HP3kRxlzB2M/21arjc2B8snExWmAhyQ=; b=gpomvId0qPFKlEmXgf0UWduntJDhorkEmBQp0iJ4zDQK/ciQqSHWIKHV8FKW1s5YvK /ADR3M55RK7KSsiCaf4yBe8IoQ2gorTcU9bB2MzhE6kbPQBi6m356fU22Gb51WzSjhlE EMLdmctXb5TlgHGqGEzR6AWN0kbvoWQyrcB+yT2vXW0PPYCg4PECteyXQVx/4picoVAy R9Xv9QOTB/BAsBPfi7H66jM24t8PD2PbIxIH9VYu/akTfZQto5ZUraGSaizTNoaCRWwR sMXnSC2fY5aQAyC9VvXfEBc1kxs0+92+vFKFF/7ovxEz7wvJ6cV6gTf3RegcYdjg/zso XT1w== 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=HkGGJTsHUc89HP3kRxlzB2M/21arjc2B8snExWmAhyQ=; b=GO1JE6tqS/CRNHdk33obYBVn5A5sLepxT+X3nK1ddoU5b1RgIPgy0B2vp4UNnWynvk ZLTPwmdCaZr0C0qa/4kDZJY9Ep7KvNedEwSFGPmue+b9cPSNSjfLoxHYAWMtXISuax1g YhWCaDNcRYA5ilhx5q0Xw6HZm67UT2lawe4Ott8bBZR59tGyI9zp4NesfLtAaXBuCbyK 3glhUoEtuL47FKdMKr0ZPmFnQccg9nnvdqB1eRuQHfjZ9sNwuVHplzljKgFJ9lbeSK4c v9vfl2IHg0cW+NpNCMaODO26QdmqOQGVXVcdQ1x/BGCh/CsKrIFUul/UD+fO+C5msVAl OT2A== X-Gm-Message-State: AKwxytdXJeFr7K812oGjwtdl3hNhWnPAmjcbjL681oSNrxxypyVNE/i8 T2wsfgWH8kQjpBHqT4iOqxF97A== X-Received: by 10.80.177.239 with SMTP id n44mr25069867edd.94.1516805441990; Wed, 24 Jan 2018 06:50:41 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id p6sm324449edb.62.2018.01.24.06.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jan 2018 06:50:40 -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, herbert@gondor.apana.org.au, davem@davemloft.net, lukas.auer@aisec.fraunhofer.de, rui.silva@linaro.org, ryan.harkin@linaro.org, Bryan O'Donoghue Subject: [RESEND PATCH 1/6] crypto: caam: Fix null dereference at error path Date: Wed, 24 Jan 2018 14:50:30 +0000 Message-Id: <1516805435-15034-2-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516805435-15034-1-git-send-email-pure.logic@nexus-software.ie> References: <1516805435-15034-1-git-send-email-pure.logic@nexus-software.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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: Herbert Xu Cc: "David S. Miller" Cc: Lukas Auer Signed-off-by: Bryan O'Donoghue --- drivers/crypto/caam/ctrl.c | 3 --- 1 file changed, 3 deletions(-) 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; -- 2.7.4