Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp715905rwp; Wed, 12 Jul 2023 23:01:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlHcjRQ52wzvzcBIPbX4GIjo9fcgdXrFg34B2F5xJl7PF3FNWvoumrkxxFAZ9LEsD8muE4AX X-Received: by 2002:a17:906:f1d2:b0:98e:a54:42e3 with SMTP id gx18-20020a170906f1d200b0098e0a5442e3mr355076ejb.54.1689228088455; Wed, 12 Jul 2023 23:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689228088; cv=none; d=google.com; s=arc-20160816; b=O2hshCVutr2e8Et3nUL5K3IC37aoNUuWbHWe9LaRhcFy1CbSNab4OFTNJEqcL/MWAy mzYCF4DxLBpyeLWZ5NYfP+9psMLJsuzRVADzQyOux01JkUybeuhJznrsyRj7Sksy+3iR C6afpPc5jMOsND5d+x//G8S3+x4l8D2TFVE66KSX/ZKS8Z5iyROiMS1iDXchnQ5SLYIX flehyraU2eNRxR5bdahncj9EGQrt8YecAVZPQhNlR85feVKvDUdH5JHxTwkIuJd01dQM Kx/GqK4NfDJ5A/a6Bug9euQRVOq9anm9ZQLnateS8VMKJv20ZnahU16i9eSfvxBXLMQW dxyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=GFMF1ikSol53pF8uOEYCDZ1uK/JIIE1rXx1j7+aTy1Y=; fh=5RC1cDy29E9Wk8WlaIcwLJdflcg22PIOh7LQAcT/o+I=; b=DN138WgK6sg+WvuH96HBbGYBBo0vRf9PY4ona2YXBPYfu5oh8Gjl2TKurng/clGXjU oFXJP0It4kvbatR3+nsQ4PdBbD5l+tJSQPtbBUrvCx8aXe4KqRGHQebm2/5SDPw2kIqk Nn2M7S0QW8d5NlwBTZKrdQ1pdOXUaq5QhOjdB35uLFQxdAin75ouKiCQWABss5ZLd4gM 1TWLiYW2ld9CqJgWzil9e3tYs+pUPns5Qos7HMUuiPNdzrXGA6sbZpr4AkZbL8EQmXxP IANqHRx3O04TIsV+9Kw0O42BuEwexxJq04c9/EQBWXko24SZKMJGdl4Tycp4vCVQrcLn XgSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=x5xLgY8K; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fi26-20020a170906da1a00b0098653c15e94si8251999ejb.117.2023.07.12.23.01.04; Wed, 12 Jul 2023 23:01:28 -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=@infradead.org header.s=bombadil.20210309 header.b=x5xLgY8K; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233283AbjGMFu2 (ORCPT + 99 others); Thu, 13 Jul 2023 01:50:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbjGMFu1 (ORCPT ); Thu, 13 Jul 2023 01:50:27 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBAAC1BD5; Wed, 12 Jul 2023 22:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=GFMF1ikSol53pF8uOEYCDZ1uK/JIIE1rXx1j7+aTy1Y=; b=x5xLgY8KePVopF6k6iKAFKM/QG P+4A2RB3luT+Ws8svb8REwmQaHeRbkoCjA9Af2WrJZb8mRuM/yjfryuJsmtFM69Y3IssVptJJTksC RG7x556xM0UQIkcBxlIIN4Zef6sOPTp7Q7twuECA1YqrVG/8ndJnKCf6zs2HF9dS78IC1uh+Xx4Oj t4AIjyGIugFrOD3fIoJWGFZZsKCWJuYJyxdguKPnI5u/yIuAme0Fo3ySGMVufMUWtgEHpKsatIIxP +L1qSalel55POdhvo+0+AVTAhscTS70DCmxARuO5QPwJaRhSPxGTKTjsvNOuWm2FuZ7Luup69oQ2A lQDDfFrg==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qJpDS-0022Nf-05; Thu, 13 Jul 2023 05:50:14 +0000 Message-ID: <27105f25-f3f9-0856-86e5-86236ce83dee@infradead.org> Date: Wed, 12 Jul 2023 22:50:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH net v1] bna:Fix error checking for debugfs_create_dir() Content-Language: en-US To: Wang Ming , Rasesh Mody , Sudarsana Kalluru , GR-Linux-NIC-Dev@marvell.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Krishna Gudipati , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com References: <20230713053823.14898-1-machel@vivo.com> From: Randy Dunlap In-Reply-To: <20230713053823.14898-1-machel@vivo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 Hi-- On 7/12/23 22:38, Wang Ming wrote: > The debugfs_create_dir() function returns error pointers, > it never returns NULL. Most incorrect error checks were fixed, > but the one in bnad_debugfs_init() was forgotten. > > Fix the remaining error check. > > Signed-off-by: Wang Ming > > Fixes: 7afc5dbde091 ("bna: Add debugfs interface.") Comment from fs/debugfs/inode.c: * NOTE: it's expected that most callers should _ignore_ the errors returned * by this function. Other debugfs functions handle the fact that the "dentry" * passed to them could be an error and they don't crash in that case. * Drivers should generally work fine even if debugfs fails to init anyway. so no, drivers should not usually care about debugfs function call results. Is there some special case here? > --- > drivers/net/ethernet/brocade/bna/bnad_debugfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c > index 04ad0f2b9677..678a3668a041 100644 > --- a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c > +++ b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c > @@ -512,7 +512,7 @@ bnad_debugfs_init(struct bnad *bnad) > if (!bnad->port_debugfs_root) { > bnad->port_debugfs_root = > debugfs_create_dir(name, bna_debugfs_root); > - if (!bnad->port_debugfs_root) { > + if (IS_ERR(bnad->port_debugfs_root)) { > netdev_warn(bnad->netdev, > "debugfs root dir creation failed\n"); > return; -- ~Randy