Received: by 10.223.176.46 with SMTP id f43csp927531wra; Fri, 26 Jan 2018 09:03:24 -0800 (PST) X-Google-Smtp-Source: AH8x225fU6Nv3vrH8du7RYWUdKgCLMVA+VGJciIGyxae80Mkrv4wLS7vyqHOOEKX3OEnDDH5F1Kz X-Received: by 10.99.151.2 with SMTP id n2mr13554862pge.87.1516986204749; Fri, 26 Jan 2018 09:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516986204; cv=none; d=google.com; s=arc-20160816; b=gyi2i+hxK+9u+3MsQPTyFt+0HklIQ0XYcdh+YXM/FkFhVRhhUtkuDYe9JMuAfOuYny FsaT2zsGmjJ+raxSEQm76jl65jNodAzacV5444FcmZCIB5cL+rLos2NLaEFeP40li5m/ inivBgGlqSeA8v40BTfGz7m5jqu8xUzFJHblTNVA8l5r+VwhA8NtC55o0Li1W3wOZOPG Ax1gCxFwvhEga1SvBqr2D6ZllF9cD4mSlUYnb8XyS5sIYXBRLy9FktCX2miF/bMY3p7a bHlP3vokxgATujQ3qvplQrp711B26qh8aKQHz8LtFk8gE3W1epqbD1MH1NxLaOZ49z6/ T2KA== 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=v6TgMji/4fk8TyV1U5jfTf2gA4tNTNu030wTtOgSKJ2oDz8FMwoR+B+wCuXYEy/OB3 fsikLUR13kZ9G5Rb2xSqexdNr5ws/XP/P45wL9yJrjUQoJmCBpa0K0jrH9rFonwW6f2W uecM3grGueqDfjn5wD44wT0bWbrIHH2WvN+msoKDAhH2KXVeNTAgho6liDrH+91cuO+I BmDBsu4phrbbeyCvZyfR08f0X3S52g0xSOj+v85uPP/SaKR3FLKCFWax6GbqTod994HB KnSJAOGERLxtfM7LRor96ilReawOo38RNcl1WQKdZP+sBfujklEaZ5Ix7m3o5NFPuvC+ LboQ== 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-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 201si6586758pfu.37.2018.01.26.09.03.10; Fri, 26 Jan 2018 09:03:24 -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=G+LP4LdL; 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 S1752619AbeAZRBj (ORCPT + 99 others); Fri, 26 Jan 2018 12:01:39 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:55023 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751847AbeAZRAI (ORCPT ); Fri, 26 Jan 2018 12:00:08 -0500 Received: by mail-wm0-f68.google.com with SMTP id i186so2570634wmi.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=b1jbda8fw8sYz0eNN4NJSjLDoGT/tAzqTYWbrgTm5VSOWLbJnKmSXwxGvYcjF7s7XX Nr8/1m+uU9nA+KCMiKk73hsra9y0V2yrlimo92rqZAX9fh1yqFJT/rPHIw10DQnlXW1M 9QEqXd/9FVzuCDc6NAyxw/K1UhZNq/HaJxmYlLz/26opi7nZFq8DxUDKG3dT7XT+kxEa P/EWePgW21ENeIJr8fUzvIIvSvnGbdTTWxz9LjrVNT/ZH0XDE1BwP6KfaTWxDwq8dWD9 RCuwo2kZhpAqAZXVworNTTtvGft4oGaLVA72mtdmPX6b/DbyThJWTJ99p4Dw4IQM8U0Q 7ppg== X-Gm-Message-State: AKwxytfwcd4a8rqfCceLcg3tBsgIttlG34itYZWNgTqAxFX4spDNjS5T X9zuz6s2aEvwzjJxPFuAAn+wJw== 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 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 Cc: # 4.12+ Reviewed-by: Horia Geantă 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