Received: by 10.223.176.46 with SMTP id f43csp1056625wra; Fri, 26 Jan 2018 11:06:24 -0800 (PST) X-Google-Smtp-Source: AH8x227WxQx9ObFT8Wcmqjl2kGnTQZfA7L/ncgeyxA+U0CTbH/KHm3c+oamCgcr6zDYT/uxXTd14 X-Received: by 2002:a17:902:8f86:: with SMTP id z6-v6mr15072961plo.352.1516993584390; Fri, 26 Jan 2018 11:06:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516993584; cv=none; d=google.com; s=arc-20160816; b=BFJ+CZpukVIRims/C2HD2MMXZtPszrJd750vSVBXUJnzRHCQIXwTiN/fkDF2XF52jw 8HZunx0vCu21tYc/Exohimm8HJe/sXPpb0ZQb9tqWxPjoVxRwL9j8EEs2Z5ajbVQ1HfK AYbUqrBEp99iS7La877uVf/dEw0osX7j3uzH+5m4aB/KKgH5kb3fC8ZWcCMFY74u5OkH xiLfoJjpuymDp9fA4wiDTSXdW7zpdD+5z0gLPvbzHOSLkK2RqM+thGxlM5EyFSslYZ1/ 2E8/9ZWmTO6m900WEJAIzec/Wy5mqZyN0C7pXJmLwHfelk8P4DY+cPbE+89SBzvIRR8x Jf5A== 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=ibGkiLBOXo+GSmUFCkyevbyiTW9G/cKG9S8jhA3SzWrXkyEJFo3ZMRqaJnzO0HmZT+ MZfq2qacDbfqJoa6OyRvGZG813e3zF0sDT/ghccxaQSnjj4NTH903iw0+qsn9yEsUw4e qWtoda/7G16VrM4d1JTptG244RR/NaZndLwKTT87qkJ32ruJXW0WH0FcPlIqSQnhNspz kxPFks2ZOD1kAwvKHYLWq1PodBeeIgiECRxlTMfJGDt2gm4zA6L0vvQjR7fLJVzp8r5U M3z190eDCHpWB1arsIdB8dzpv1QXX/6+H8S/q8r80xiwBy8pH1DGGTXiVvQZrJMJb0ur 7ooA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=JMkjS6LC; 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 84si6753422pfp.230.2018.01.26.11.06.09; Fri, 26 Jan 2018 11:06: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=JMkjS6LC; 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 S1752529AbeAZTFY (ORCPT + 99 others); Fri, 26 Jan 2018 14:05:24 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34221 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752589AbeAZTFQ (ORCPT ); Fri, 26 Jan 2018 14:05:16 -0500 Received: by mail-wm0-f68.google.com with SMTP id j21so27835487wmh.1 for ; Fri, 26 Jan 2018 11:05:15 -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=JMkjS6LCBYxn7hgFm4Ei07nb4E3tntrs9YW5KMeirF3D4NRTOW0oXzVQyE0ByegFkU sXiznZ5L8K1jWnhclxVOL72r2I9pxaKSJDWD9OrInXbNagbAY/dGKg3ixMHxKJCO+4ol ujU+CeNJbCMzYliuPwVQ1ACmXbGwiiQ2XvKKnFcrzzGVMpTNRyPtTxiCCGlhE9KywsDq E2GRr7F2BjFZyoNpdGfviFS9QxnQIBxIrDeD0JfT6S7CUo3gP0x1zMUCst83FocxQ0hN uH1hVngrt6to3X8frf8ICmlHegVj2bZMlymvAMUMDN/PpjcChcO5VObrcratiRpiz+Tv flPA== 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=QhcuDWnvrsN/uGFghpJhW1d/rjgeM7DM6S+r79EAJFrtCBw1h6Z7sArkNIuFJAHDS0 ZdMONIfe/bSVvIrIa3sKlKWIKs+AUFAoyp2pmnx46J1SbkrEPhQyAH7r/ACdTb6aMxFA Bmfg/t20DhI6mZrgiQ38XdsGIYT4UJcUlkM2sJ9gGC7mImNyM+t7za4k8d0ipa9SZpOl xtOD7kQ1RXUMvBpR4sFHBu2Z+IEdpu5gxr3IeuLv1FtvElhzKBEsWKJOAzwERnrzXFg7 1C/rXE8X3tmn1OQb66QNKwvsRQc2lx0MYlaGaDDB3yNTmKkJ7X/NZyuVBUVE6ypvv1uN OY3g== X-Gm-Message-State: AKwxyteY3H4Cpvdn/+kPA20Wg8hh06N44oiKXON08u8zw3FGdEiPqV9W /OjrvRmjK/Ga4vkJVyEZUvi3Eg== X-Received: by 10.80.184.77 with SMTP id k13mr36425150ede.187.1516993515142; Fri, 26 Jan 2018 11:05:15 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id k12sm2719836edl.86.2018.01.26.11.05.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Jan 2018 11:05:14 -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: [RESEND PATCH v2 1/5] crypto: caam: Fix null dereference at error path Date: Fri, 26 Jan 2018 19:04:57 +0000 Message-Id: <1516993501-29646-2-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516993501-29646-1-git-send-email-pure.logic@nexus-software.ie> References: <1516993501-29646-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