From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 100A41775C for ; Wed, 9 Aug 2023 11:23:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81CF9C433C9; Wed, 9 Aug 2023 11:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691580214; bh=FCLMibFVuhFZ3Zi1V5QfhvJNRA5jhOqFvSwHWIv8tI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nex16sOBXXFx3B2jnqWbaAGKo7eOyhp6AkJ1TOFK4xcy98jjPtTdmDr6dj9IiioAs i6imFlzKQEai1CVzMhvzg5UaAoHRoK+1f16ElHW+N4QmQpCBfsVKSWCXFDTAl6gHkM WNwDzdV6tOeMEnf14TBVxpRiR+WUw//FfxPbolBE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wang Ming , Tony Nguyen , Sasha Levin , Pucha Himasekhar Reddy Subject: [PATCH 4.19 238/323] i40e: Fix an NULL vs IS_ERR() bug for debugfs_create_dir() Date: Wed, 9 Aug 2023 12:41:16 +0200 Message-ID: <20230809103708.968560234@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230809103658.104386911@linuxfoundation.org> References: <20230809103658.104386911@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Wang Ming [ Upstream commit 043b1f185fb0f3939b7427f634787706f45411c4 ] The debugfs_create_dir() function returns error pointers. It never returns NULL. Most incorrect error checks were fixed, but the one in i40e_dbg_init() was forgotten. Fix the remaining error check. Fixes: 02e9c290814c ("i40e: debugfs interface") Signed-off-by: Wang Ming Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c index a66492b9403c4..5b82c89330e30 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c @@ -1798,7 +1798,7 @@ void i40e_dbg_pf_exit(struct i40e_pf *pf) void i40e_dbg_init(void) { i40e_dbg_root = debugfs_create_dir(i40e_driver_name, NULL); - if (!i40e_dbg_root) + if (IS_ERR(i40e_dbg_root)) pr_info("init of debugfs failed\n"); } -- 2.39.2