From patchwork Fri Jan 26 17:00:00 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: 126004 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp472714ljd; Fri, 26 Jan 2018 09:01:40 -0800 (PST) X-Google-Smtp-Source: AH8x224F63yi2NMJoWTLWBXObIKi9tfcS6tsDk1ZnDBsq0cztuTTttzMryy/7HjlG87oXw0/w+wX X-Received: by 10.99.97.87 with SMTP id v84mr16300021pgb.342.1516986100718; Fri, 26 Jan 2018 09:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516986100; cv=none; d=google.com; s=arc-20160816; b=yvTbLlY9OQub0k+UdZDUxnfHOL0NhzdrhQmYzAQN7PJYMPma6NwuR8dffYdmUYtqEe +UdUoBxJQ0DAciltGPsWMtgkUIaDKyV2NwdR/Q6sYcKUNYjOe13AiVndedpZaZjuSKFS BMFKCNbLX2+YMnOQKfAZbcsmlniu9vsxzUmtQTRUUC06m+pOIUwaJkOdLqAuYPrd9QjV f8HuH2jhSxF2l+mA4B0yPeDPnicwZfIRBmcuzynSpXl3z1k2uBLU+w895faowBRKrtvs 5TntVsojhzUHMgHmySxNz/Gbyw6F0x6nS+LSzhRykrrBjz0dG2t4slH7DVsQ9cciFH0y w91Q== 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=209+PrRN+sNcAfZx1gxxFaD/s1N4cpSvxg9UKXDZwbE=; b=ul2OKNNcbLzEB7qUFC+dsHWVBi8Q9JJIBHKRjK/oJXBs76w9PRYan6Yp3MxLpItRFX dz5d+hrzGkmvy2VdJAXN+UaA+DDjTabTp6Ds2oAGSos0N4eYZaGRlJSHFBJ1Q7L9l4Fx 9IqHIililVWmAnfUqo2lPGPceHuv4eWJzIAZdyKdEeRscAqY+2kTxiJKd2x7cmX0VqlF fleFIUpz2wcDRWnp+OTweFSI0kr/Kk8sotDWEejtptsvMYLRV6MkIivN1E0IEo0N2n1v TTjEFHq2tLPcUvHfwRtBw5QfvubpxXpOnlV9gD3QNnn6Cz1+oddWz9SL3EkJ75o00IeJ DqkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=G+LP4LdL; 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 d20-v6si3972861plr.660.2018.01.26.09.01.40; Fri, 26 Jan 2018 09:01:40 -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=G+LP4LdL; 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 S1751506AbeAZRBj (ORCPT + 1 other); Fri, 26 Jan 2018 12:01:39 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55021 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751860AbeAZRAI (ORCPT ); Fri, 26 Jan 2018 12:00:08 -0500 Received: by mail-wm0-f65.google.com with SMTP id i186so2570637wmi.4 for ; Fri, 26 Jan 2018 09:00:08 -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=209+PrRN+sNcAfZx1gxxFaD/s1N4cpSvxg9UKXDZwbE=; b=G+LP4LdLbECVlMGzXg9tvW8yza354YeYxHSR9rQw9hqeoN6y+FQdGeMx8iShc8RB8d frCQJmrmr3fGlat5W0ZlxExAuhVIOAQWjYWjPowkDP+uIlFxEw2zAQlkEGuh+yKqkblX M+4JWKAPUr0DHiQgvCYLCNQCg1tJ7xPATsSUU6ecAcmCndWTeHAKFt7mY9tQ9eU9YvvE PsdrCzVUeWRr0s6Wvr1w969xXeFv5cjfqVk16k3R87M5QrVp2tltJ22Qh1KCJuMXoX9u s4F1F82M/Zrgr/seBKQZe4rkkA0TvrjQqvVQvocC2MJxcGYsWUUZLSZOzTBZN+P2yyF8 Zy5w== 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=209+PrRN+sNcAfZx1gxxFaD/s1N4cpSvxg9UKXDZwbE=; b=VvQrgj0abayTLUhSFoDGwTL+DMixtxp5FeFcuZGEfJ5SenXMTSDdnKHGJRIblHeAbi K/WQIRwd1ZURX7c0SVsTVPxgdkxpXg7ngGTnn0MtsR7FdcGpVVGYRTMnQDIwEYkMlraq JBLl3wCNbFg2YVuNPt/wzVaInA5UDkLC3g+VyzPoUq+0LpqeuKJ8gJhXpCaqZk8A5nrz coOVDJiDTItoZ+liyX2SYDJr6LMEI0ZpQDPnpxnegOzwe10twxFSYG0pul20/MdmdgTD jmUIFQWHB5TRzj4rCEeOVDUinuNJFgv3py/68QyJgmadOcX/zuDumi70xSCX9hPvGf1M VFtQ== X-Gm-Message-State: AKwxytdD0vnGdWrv6jgD85/U0jphlSiV17I49ic9PpZfOxZ81k/90BGZ k8fpjhCtzIRWYcmLHP/5uya+Lw== X-Received: by 10.80.165.201 with SMTP id b9mr35441473edc.211.1516986007406; Fri, 26 Jan 2018 09:00:07 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id d21sm2733949edb.13.2018.01.26.09.00.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Jan 2018 09:00:06 -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, "# 4 . 12+" , Bryan O'Donoghue Subject: [PATCH v2 1/5] crypto: caam: Fix null dereference at error path Date: Fri, 26 Jan 2018 17:00:00 +0000 Message-Id: <1516986004-25452-2-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516986004-25452-1-git-send-email-pure.logic@nexus-software.ie> References: <1516986004-25452-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: Herbert Xu 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;