From patchwork Wed Oct 25 11:01:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 158033 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2514263vqx; Wed, 25 Oct 2023 04:02:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyz62nbc7+a+u33C1lvhiUEIEz6aGNgxs2qPD6f3O4EFG6QeaBFfDhOfpjlwitnsCABmz2 X-Received: by 2002:a05:6214:19eb:b0:66c:fc97:fbcf with SMTP id q11-20020a05621419eb00b0066cfc97fbcfmr17572561qvc.48.1698231762091; Wed, 25 Oct 2023 04:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698231762; cv=none; d=google.com; s=arc-20160816; b=ZztUInuS3wRqGJanJGDG4iqjQ0N4zsnG/q2vQZHaMk0UGMxHwCdqfPdNjOKtB9job9 Ufoz3kF6WuMvy0mn5m+HnFOIrlVISkGRONWl9rfaxTk0DSTP6ihwaR2SrOq0efPDLczb 0U+tSh2pfafVcB1d6zbq8MXajy3vVb7uyglLMPZGFCag9DXuobOL/i4qhE3gjtlk3qJR jaxDC5toNvqcPym7QalmNC+X+thytE53P8OPDv0uQzot7jvxcT9acfSWlo4mSyOKJO1C gDbXj97NrkW3UQUQnHowGlGH0joBlWcgMYBYWcstx0DMx/k0fthGuHLEN5yyirkBAHtF KjvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gC1STNfqo/ReIXjrh5ODTmjb0+/6zWRqz5Oi0kVvdL8=; fh=du7yprrumEr+xNWZpgc0EjlhjaiaRGxIAfIdvEtCiWM=; b=ycbWjBOyoQY8ITb2itiTuVcR0ki6Dxv7AcDFiA8CxPZKy2WlVPFBXFW/IM+xZOObKl YKwmTV7nM81EzeyJFKfPFyZxGHPqRcLKUzbLC2dwV8rSRE4+S/OzLa9fQz7C387iuKZ4 zCROC+F3DofqOSX8GjNi6lwbeamenHzXSWqyhwYHJ2nfq89wEGK08Agu2mEcwLAuv0jF V7T/drmiGjSrW+4DcBlpNIzW1JjssS75vpALUTgFzCJwlNzAGLwwry5Pdu5shOJC7CWD RE8UxJ1abmAOwbcFNEEIg+Nny/O4U3rmbvwgIsggsIsdoF9N05dtdMIE+9Bv0I7Y9qKQ FzuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XDPxJP0g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bs36-20020a05620a472400b007726499db83si8438606qkb.229.2023.10.25.04.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 04:02:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XDPxJP0g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 308198025439; Wed, 25 Oct 2023 04:02:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234655AbjJYLB5 (ORCPT + 26 others); Wed, 25 Oct 2023 07:01:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234715AbjJYLBs (ORCPT ); Wed, 25 Oct 2023 07:01:48 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B644189 for ; Wed, 25 Oct 2023 04:01:46 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-53e04b17132so8664630a12.0 for ; Wed, 25 Oct 2023 04:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1698231704; x=1698836504; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gC1STNfqo/ReIXjrh5ODTmjb0+/6zWRqz5Oi0kVvdL8=; b=XDPxJP0gZYInX9OA/c/VCeHS6F/3gWUZATS9yGOaGaM9kVgMaZ26M0/nMT9OTE91n6 ceWYiMVAt3/7LnXMk+pEoOuBe2bIEOXgHb/vgFOCTuHdrHA2HALlXcmA7qAB/RwE9RgX n93o3csd25lrNPkFhY9NUNtUuKJgyCRofGxIo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698231704; x=1698836504; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gC1STNfqo/ReIXjrh5ODTmjb0+/6zWRqz5Oi0kVvdL8=; b=uyMFNd0h8gHhCl+9JsUoVapx2IR5DWgQvYyFSPgumiaV77c3cBV6Sdlbh4W4SwO5a5 nxf2Vh2ouIC0d9S8pHKvDYVj0P2NJWm7zHEdifmqtq4+FU4AkbmV4A0mHGzgHfjP7y4b ERKd13LkL6kQx1GEECfT1eEhWZowCmwK+l+Y6Ocm18QoUsPw1dDMJNt44zAaXHcryTmh KkNTxgp+cBxYQtaY+kNtfSkJjrqG128c5xfraczg+Kk5M8Y85UmepS+tEbOGxAebgmzl CEWyArzatHSKnESagP8E/iao5yg74Lt2/qDx4zOnzaq+DVmdT/TXoWUCWT7JuA0NXCyw 2h5A== X-Gm-Message-State: AOJu0Ywck7fnr9v+vVwKjJpQ/vGrdXrUrs1tPZsgdH1s8ZJ+B+ahOcXT w7HgnOEuW13aEO6O1sAJNQZkYFDE0g0Usj7B6JD9qw== X-Received: by 2002:a50:d0c1:0:b0:540:ea03:af81 with SMTP id g1-20020a50d0c1000000b00540ea03af81mr819224edf.41.1698231704313; Wed, 25 Oct 2023 04:01:44 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-82-50-51-252.retail.telecomitalia.it. [82.50.51.252]) by smtp.gmail.com with ESMTPSA id v15-20020a056402174f00b0054042ebbb86sm5222999edx.89.2023.10.25.04.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 04:01:43 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Dario Binacchi , Joerg Roedel , Jonathan Hunter , Krishna Reddy , Robin Murphy , Thierry Reding , Will Deacon , iommu@lists.linux.dev, linux-tegra@vger.kernel.org Subject: [PATCH] iommu/tegra-smmu: fix error checking for debugfs_create_dir() Date: Wed, 25 Oct 2023 13:01:31 +0200 Message-ID: <20231025110140.2034650-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 25 Oct 2023 04:02:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780725068122268418 X-GMAIL-MSGID: 1780725068122268418 The return value of debugfs_create_dir() should be checked using the IS_ERR() function. Signed-off-by: Dario Binacchi --- drivers/iommu/tegra-smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index e445f80d0226..cd1d80c4c673 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -1056,7 +1056,7 @@ DEFINE_SHOW_ATTRIBUTE(tegra_smmu_clients); static void tegra_smmu_debugfs_init(struct tegra_smmu *smmu) { smmu->debugfs = debugfs_create_dir("smmu", NULL); - if (!smmu->debugfs) + if (IS_ERR(smmu->debugfs)) return; debugfs_create_file("swgroups", S_IRUGO, smmu->debugfs, smmu,