public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] bus:Fix error checking for debugfs_create_dir() in mvebu_mbus_debugfs_init()
@ 2023-07-12 13:23 Wang Ming
  2023-08-04 14:08 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Ming @ 2023-07-12 13:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Wang Ming, Liu Shixin, Rob Herring,
	linux-kernel
  Cc: opensource.kernel

debugfs_create_dir() does not return NULL,but it is
possible to return error pointer. Most incorrect error checks
were fixed,but the one in mvebu_mbus_debugfs_init() was forgotten.

Fix the remaining error check.

Signed-off-by: Wang Ming <machel@vivo.com>
---
 drivers/bus/mvebu-mbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 00cb792bda18..4c514894cc1f 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -993,7 +993,7 @@ static __init int mvebu_mbus_debugfs_init(void)
 		return 0;
 
 	s->debugfs_root = debugfs_create_dir("mvebu-mbus", NULL);
-	if (s->debugfs_root) {
+	if (!IS_ERR(s->debugfs_root)) {
 		s->debugfs_sdram = debugfs_create_file("sdram", S_IRUGO,
 						       s->debugfs_root, NULL,
 						       &mvebu_sdram_debug_fops);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] bus:Fix error checking for debugfs_create_dir() in mvebu_mbus_debugfs_init()
  2023-07-12 13:23 [PATCH v1] bus:Fix error checking for debugfs_create_dir() in mvebu_mbus_debugfs_init() Wang Ming
@ 2023-08-04 14:08 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2023-08-04 14:08 UTC (permalink / raw)
  To: Wang Ming; +Cc: Liu Shixin, Rob Herring, linux-kernel, opensource.kernel

On Wed, Jul 12, 2023 at 09:23:28PM +0800, Wang Ming wrote:
> debugfs_create_dir() does not return NULL,but it is
> possible to return error pointer. Most incorrect error checks
> were fixed,but the one in mvebu_mbus_debugfs_init() was forgotten.
> 
> Fix the remaining error check.
> 
> Signed-off-by: Wang Ming <machel@vivo.com>
> ---
>  drivers/bus/mvebu-mbus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
> index 00cb792bda18..4c514894cc1f 100644
> --- a/drivers/bus/mvebu-mbus.c
> +++ b/drivers/bus/mvebu-mbus.c
> @@ -993,7 +993,7 @@ static __init int mvebu_mbus_debugfs_init(void)
>  		return 0;
>  
>  	s->debugfs_root = debugfs_create_dir("mvebu-mbus", NULL);
> -	if (s->debugfs_root) {
> +	if (!IS_ERR(s->debugfs_root)) {

No need for this check at all.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-04 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12 13:23 [PATCH v1] bus:Fix error checking for debugfs_create_dir() in mvebu_mbus_debugfs_init() Wang Ming
2023-08-04 14:08 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox