Received: by 10.223.176.5 with SMTP id f5csp700043wra; Tue, 30 Jan 2018 18:05:15 -0800 (PST) X-Google-Smtp-Source: AH8x224uGpNrkxaTQFt+yqmam6RheErNjGkPcm4WnpSAdRC/wV3KxpZHPj+You0orcjmjPfmJr0X X-Received: by 10.98.204.144 with SMTP id j16mr32510434pfk.101.1517364314974; Tue, 30 Jan 2018 18:05:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517364314; cv=none; d=google.com; s=arc-20160816; b=im0SlNShXjXWiPCIecNQ7SXuThtlygANwYx8iF2hrq4XRpY7ZoS8JS7E97/Tga3ATq il1O5i3p7+FfRYkEaGqQnyaoc4uwB7UnjwzHquUYvmfNn3XpDvgsOMo/0LEPx+A9jFAU cWCKVja8TNi4nfzuI0/yVehmb2lyE2aUZZKmSBHZy34c+AHceDMQmoq+cEO2d/YpYkyF mTnkNuFli5AqLe/k4NLCrGKWGXym0hBugyDEILpufJZnNEbHKLZOrKsi/sBfS+DxGs8M VH9pAwji0JwmZ1XGNlD8Lv08BPoyCCy+NChJ7BSwJ8ujD7JFmVhDihL9Doeh4xEM7PH7 BeNw== 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=lK1evu069Q+X1xQ65EpxerY5N9WoQNybb5njXqfqenSY3yuqzr4RlBqZRva6HXOeO3 i3X+LsXgxJDzxOPxVKkb3tob8C0LBFRSqqtQRRyBp8vstI31DUCpiK1nzfOzuZcPiJOh PsLDfcMfFFl3AqQ24ywIoGkvtjHLXDe5/nVciLjim8Qmrh2kUcwrdfM2bm05yqzY0xsz JIH3fAOpcJF25NAwvs1xBixMq1na5EvwQoAE/cuYN08aDu9H06Ys7tsBkifwlkC8pXFj HxTJTFSRPyJqoZatiVFuxpp+D+XgsOKKJJ3OMtAHPHIi8kLn9YWUtT/6pkRqplWjHyY1 e78A== 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-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 p8si161733pgr.443.2018.01.30.18.05.00; Tue, 30 Jan 2018 18:05:14 -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=J/ak7NCs; 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 S1752690AbeAaCDt (ORCPT + 99 others); Tue, 30 Jan 2018 21:03:49 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:38113 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752886AbeAaCAo (ORCPT ); Tue, 30 Jan 2018 21:00:44 -0500 Received: by mail-wm0-f67.google.com with SMTP id 141so4844384wme.3 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=gQ0aljo1P26ow6D7ykEsPyxbHSN3vPPjHnaCrlvBhJPIi8f7MgL78JcS3kqiO5+L0y pWmEpfNAk2rcNebHCI6zWm73DqZ1flucrAO6pX9CUK2koSPpbkL+BgXb8OhpZCPCpcax WbmAmHumP7GVCWgj6NPwIkBond8PyZCmMNOcwxcGSrcLkCLIaooXkj7VcGcHj7+DkerX qHDHVZD21R2oQct09kwWTZwA4NJaAL25UKoKhIdNHl8bkn/2xlL81QC1SRbeJWLUkANz q+73WaDtNyirLoGBOt+GRwHv6i7wOKho0A03oF36Odg7AUuYhRDNHKleygPO5LZZKfv/ IyAg== X-Gm-Message-State: AKwxytfqX4vEl2U7ADgc14fvEp5JH3+0314JNZqVbr5S7lVPhVqtGkXO M2loE9w1ne/0xjLEu9emGESbsg== 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 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: "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