mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] EDAC/altera: Fix error checking
@ 2023-05-17 19:15 Yeqi Fu
  2023-06-07  8:51 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Yeqi Fu @ 2023-05-17 19:15 UTC (permalink / raw)
  To: dinguyen, bp, tony.luck; +Cc: Yeqi Fu, linux-edac, linux-kernel

The function edac_debugfs_create_dir returns ERR_PTR if an error
occurs, and the appropriate way to verify for errors is to use the
inline function IS_ERR. The patch will substitute the null-comparison
with IS_ERR.

Signed-off-by: Yeqi Fu <asuk4.q@gmail.com>
---
 drivers/edac/altera_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 8b31cd54bdb6..19693333408f 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -683,7 +683,7 @@ static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci,
 		return;
 
 	drvdata->debugfs_dir = edac_debugfs_create_dir(drvdata->edac_dev_name);
-	if (!drvdata->debugfs_dir)
+	if (IS_ERR(drvdata->debugfs_dir))
 		return;
 
 	if (!edac_debugfs_create_file("altr_trigger", S_IWUSR,
-- 
2.37.2


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

* Re: [PATCH] EDAC/altera: Fix error checking
  2023-05-17 19:15 [PATCH] EDAC/altera: Fix error checking Yeqi Fu
@ 2023-06-07  8:51 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2023-06-07  8:51 UTC (permalink / raw)
  To: Yeqi Fu; +Cc: dinguyen, tony.luck, linux-edac, linux-kernel

On Thu, May 18, 2023 at 03:15:56AM +0800, Yeqi Fu wrote:
> The function edac_debugfs_create_dir returns ERR_PTR if an error
> occurs, and the appropriate way to verify for errors is to use the
> inline function IS_ERR. The patch will substitute the null-comparison
> with IS_ERR.
> 
> Signed-off-by: Yeqi Fu <asuk4.q@gmail.com>
> ---
>  drivers/edac/altera_edac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
> index 8b31cd54bdb6..19693333408f 100644
> --- a/drivers/edac/altera_edac.c
> +++ b/drivers/edac/altera_edac.c
> @@ -683,7 +683,7 @@ static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci,
>  		return;
>  
>  	drvdata->debugfs_dir = edac_debugfs_create_dir(drvdata->edac_dev_name);
> -	if (!drvdata->debugfs_dir)
> +	if (IS_ERR(drvdata->debugfs_dir))
>  		return;
>  
>  	if (!edac_debugfs_create_file("altr_trigger", S_IWUSR,
> -- 

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

end of thread, other threads:[~2023-06-07  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-17 19:15 [PATCH] EDAC/altera: Fix error checking Yeqi Fu
2023-06-07  8:51 ` Borislav Petkov

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

all inboxes | Powered by JetHome®