Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1748484rwd; Sun, 28 May 2023 01:40:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4AMUxrM5AEOGdvjthe9PyQD8gdSZv1dy26IZ2GDVfkyvBg19r1J8G4393UZKA3BXqwbYyL X-Received: by 2002:a17:90b:68f:b0:252:89bc:1cd9 with SMTP id m15-20020a17090b068f00b0025289bc1cd9mr4662734pjz.20.1685263216031; Sun, 28 May 2023 01:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685263216; cv=none; d=google.com; s=arc-20160816; b=nOnyKl7J6e4bN04oSglYHkURzCkpZUGRXE4RIGGnLE5uYFE6Mu5yjgrR0HYPKxNG4x hz6qYmrDq3mRazJRTPHu+EruJ+QgoRCOOk7WUJbuyuyivgZb6D4IONWPLfhaJKD+8zWV GBl1azFkXI4brpkgyNAD02j+BvihlwxyGDIcFEZ1w4p7Ve4+RBuDS3ZyGXvkObgnJBA7 +7o3Jn7NiReTUj2aHEbuxAAOokZQS2GYUcWvemNd6P51OaQG7YN3v9dhxXmktQNDVCR3 mCF7n1X5d5riCj7UfJnmykZeOFwiB5OJOriKyxPZDokbeB1Ir6A+jRGT9x0DY0evibfG AQ2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4D5zyQVTU7WLavKiZQ1PRGGdFTDyG2cq8tBwIWTJgwc=; b=gJC69tEPYRW1FaTyA5v9LlXaOnO8ydjydmbv9YhXVETsWue12AxDlC0734hqEU+Ydj m6hPrHhFEp88f11z2UvR3xT7iiC011MFO5k1ZV+HBo8Og4s333aniEiOayDXgUvxVOpn VSjIGZ/WFX0LC/B5N707bR6JfRRhai0UXfOsHuePL7jwNF9EomXEN/BwaJa0ts4KXggf dX6bpQf73pVVivSrdtPbc94rEIPshRMJQrw+Lhjg/nDVMj6XArY1JyTuiRIY0FQz5sPz QTFlOo7P8AVsm3ZJ5nnuqIBH0km6oFGttj4DGGwfI7gzO1j4PZWANZrtseoDVk+p2mtv U4mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FRpKjehm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a17090a4a0e00b002567299406esi525272pjh.37.2023.05.28.01.40.03; Sun, 28 May 2023 01:40:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FRpKjehm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229560AbjE1H5I (ORCPT + 99 others); Sun, 28 May 2023 03:57:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjE1H5H (ORCPT ); Sun, 28 May 2023 03:57:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FA47DC for ; Sun, 28 May 2023 00:57:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A9E5760C89 for ; Sun, 28 May 2023 07:57:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6F2AC433D2; Sun, 28 May 2023 07:57:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1685260625; bh=UuZyK9hXvbOMSMv0+Ol5EZmZ0bFahKWss3TY5SSSesA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FRpKjehmsVXpYGmBZOZRLP/dPWa+8wCRiRgFhGTtxssDaIJMUy2AOVsM98yFKX5W0 n8MW0Dout/vGg5N2xvbBMhJJ90LfPZHrplvxUPWc5koDT4fvwX3ynJ7LxY+U9jcvbJ SmXOcP2eh4Ca3S5p3TazXa8XJoyPfB7/aw1Q6g58= Date: Sun, 28 May 2023 08:57:02 +0100 From: Greg KH To: mirimmad@outlook.com Cc: Immad Mir , Ivan Orlov , Michael Ellerman , Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc: fix debugfs_create_dir error checking Message-ID: <2023052835-oxidant-doily-404f@gregkh> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 28, 2023 at 01:16:44PM +0530, mirimmad@outlook.com wrote: > From: Immad Mir > > The debugfs_create_dir returns ERR_PTR incase of an error and the > correct way of checking it by using the IS_ERR inline function, and > not the simple null comparision. This patch fixes this. > > Suggested-By: Ivan Orlov > Signed-off-by: Immad Mir > --- > arch/powerpc/platforms/powernv/opal-xscom.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c > index 6b4eed2ef..262cd6fac 100644 > --- a/arch/powerpc/platforms/powernv/opal-xscom.c > +++ b/arch/powerpc/platforms/powernv/opal-xscom.c > @@ -168,7 +168,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn, > ent->path.size = strlen((char *)ent->path.data); > > dir = debugfs_create_dir(ent->name, root); > - if (!dir) { > + if (IS_ERR(dir)) { > kfree(ent->path.data); > kfree(ent); > return -1; Why is this driver caring if debugfs is working or not at all? It should just ignore the error and keep moving forward. And -1 is not a valid error number :( Have you hit this error on this driver? thanks, greg k-h